-
Notifications
You must be signed in to change notification settings - Fork 551
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
Memory leak in concatenation operator overload #16823
Comments
From zdm@softvisio.netCreated by zdm@softvisio.netNew memory leak was introduces in perl 5.28. #!/usr/bin/env perl use strict; package AAA { use overload # return AAA->new; sub new { return bless {}, $_[0] } sub DESTROY { print "DESTROY\n" } print "--- start\n"; { my $s = '1' . ( '2' . ( '3' . ( '4' . ( '5' . $o ) ) ) ); print "--- exit scope\n"; print "--- end\n"; 1; Output: --- start Refs count should stay untouched, but it increased on each iteration. Perl Info
|
From @tonycozOn Tue, 22 Jan 2019 02:50:40 -0800, zdm@softvisio.net wrote:
This is present in blead too. There's two places the reference count is being incremented. The first is in leave_adjust_stacks() as the return from the '.' overload is being processed: (gdb) bt Each of these is added to the tmps stack. The second is in Perl_pp_multiconcat at the end of the magical value fallback code: (gdb) bt if (is_append) targ here comes from the PAD: SV **svp = &(PAD_SVl(PL_op->op_targ)); Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Tue, Jan 22, 2019 at 04:17:47PM -0800, Tony Cook via RT wrote:
...
After each call to multiconcat that returns an overloaded value, its targ I'll need to think a bit about the best way to avoid assigning to the -- |
From @jkeenanOn Tue, 22 Jan 2019 10:50:40 GMT, zdm@softvisio.net wrote:
FWIW, bisection points to this commit: ##### Add OP_MULTICONCAT op Thank you very much. -- |
From @iabynOn Thu, Jan 24, 2019 at 12:00:41PM +0000, Dave Mitchell wrote:
Now fixed in blead with this commit: commit 4e521aa Avoid leak in multiconcat with overloading. which is part of this just-pushed branch: Author: David Mitchell <davem@iabyn.com> [MERGE] various overload fixups -- |
@iabyn - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.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#133789 (status was 'resolved')
Searchable as RT133789$
The text was updated successfully, but these errors were encountered: