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
Combination of tie() and loop aliasing can cause perl to crash. #8842
Comments
From mjcarman@mchsi.comThis is a bug report for perl from mjcarman@mchsi.com, It's possible to cause a crash in perl by using a combination of tie() and the #!perl package Death; package main; tie my @array, 'Death'; foreach my $p (@array) { __END__ The code in the example isn't useful (obviously). It's a distilled version of The crash only occurs when the loop variable appears multiple times in the same %h = (a => $p->{a}, b => $p->{b}); # crashes It isn't often that Perl grants me a peek at its juicy innards, but I caught a From here on I'm speculating, but it appears that *both* fetches are being done Flags: Site configuration information for perl v5.8.4: Configured by ActiveState at Tue Jun 1 11:52:09 2004. Summary of my perl5 (revision 5 version 8 subversion 4) configuration: Locally applied patches: @INC for perl v5.8.4: Environment for perl v5.8.4: |
From @iabynOn Wed, Mar 21, 2007 at 09:18:16AM -0700, mjcarman @ mchsi. com wrote:
The fault can be reduced to the following: sub TIEARRAY { bless [] } tie my @array, 'main'; my $p = \$array[0]; It's yet another manifestation of the fact that items on the stack aren't $p is a reference to a proxy object (a PVLV) that calls FETCH Actually its slightly more subtle than that; there's a hack in $a = $a->[0] to work (otherwise the value in the array would be freed just after $a In the case of ties however, the call to FETCH triggers a freetmps which I can't see any simple way of fixing this (short of making the stack Dave -- |
The RT System itself - Status changed from 'new' to 'open' |
From @davidnicolOn 3/21/07, Dave Mitchell <davem@iabyn.com> wrote:
alternative complex proposal: Having two tmp zones might be easier than adding flags: regular freetmps simple proposal with possibly acceptable side effects: nonstarter docpatch proposal: |
From @bulk88On Wed Mar 21 09:18:15 2007, mjcarman@mchsi.com wrote:
The following package Death; package main; tie my @array, 'Death'; foreach my $p (@array) { with threaded win32 perls, 5.10 5.12 5.14.2 win64 5.17.6 win32 I think this has been fixed by now, last discussion was in 2007, which -- |
From @iabynOn Wed, Dec 26, 2012 at 01:20:06PM -0800, bulk88 via RT wrote:
Bisect shows it was fixed by my fd69380.
If you think the problem's fixed, why do you think the problem needs although I can't remember the details now, I remember changing the tmps commit efaf367 add Perl_magic_methcall -- |
From @bulk88On Sun Dec 30 05:27:42 2012, davem wrote:
Good. Technical reasoning to this bug is now known.
I never debugged the details on this bug, so I can not 100% claim "it -- |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#41948 (status was 'resolved')
Searchable as RT41948$
The text was updated successfully, but these errors were encountered: