-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perl_reg_named_buff_fetch may be allocating an AV it doesn't need to #15882
Comments
From @petdanceCreated by @petdanceLook at the retarray variable in Perl_reg_named_buff_fetch in regcomp.c. Here's an abbreviated version of the function: Perl_reg_named_buff_fetch The way I read this, retarray is getting a newAV() even though it might If the condition at line D is never taken, then retarray will never Can someone who knows more internals than me check this out? Perl Info
|
From @tonycozOn Sun, 19 Feb 2017 21:50:53 -0800, petdance wrote:
You seem correct to me. As is this will leak an AV on each call if the last regexp didn't have named groups: # let's leak PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND Did you want to submit a patch? Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @petdanceHow much memory is in an AV? |
From @tonycozOn Mon, 20 Feb 2017 08:39:11 -0800, petdance wrote:
On 64-bit systems, 16 bytes for the head, 40 bytes + allocation overhead for the body. Perl_reg_named_buff_fetch() is part of the implementation of %- and %+ too, so code like: ./perl -Ilib -e '"x" =~ /x/; while (1) { $-{foo} }' leaks in the same way as my first example. Tony |
From @tonycozOn Mon, 20 Feb 2017 20:57:23 -0800, tonyc wrote:
I've fixed this in 853eb96. Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
From @petdance
Thanks. I had the same patch on a branch but didn’t have time to send it in last night. I didn’t know about svleak.t, so thumbs up on that. Shouldn’t this go into the release notes somewhere, that we fixed a memory leak? -- |
From @tonycozOn Tue, 21 Feb 2017 06:48:10 -0800, petdance wrote:
It's now in perldelta. Tony |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#130822 (status was 'resolved')
Searchable as RT130822$
The text was updated successfully, but these errors were encountered: