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
Core dump caused by goto #9104
Comments
From @jdheddenCreated by @jdheddenGiven the following code (attached): #!/usr/bin/perl use strict; { my $isa = \&UNIVERSAL::isa; *UNIVERSAL::isa = sub MAIN: Under 5.10.0, the above produces: Jumping to original isa Commenting out the designated print statement produces: Use of uninitialized value $isa in goto at ./bug.pl line 21. Correspondingly, under 5.8.8 it produces: Jumping to original isa and Use of uninitialized value in goto at bug.pl line 14. The above shows that the goto is actually working, but the I use the above mechanism in my module Object::InsideOut. Use of uninitialized value within @cc in goto at t/15-type.t line 121. Use of uninitialized value in subroutine entry at Perl Info
|
From @jdhedden |
From @jdheddenThis bug is also evoked with the following (attached): #!/usr/bin/perl use strict; sub isa isa({}, undef); Under 5.10.0, this produces: Use of uninitialized value in goto at ./goto_bug2.pl line 11. Commenting out 'use warnings' suppresses the warning. |
From @jdhedden |
From maddingue@free.frJerry D. Hedden wrote:
But this warning also happens with previous versions of Perl, so it's $ /usr/local/perl/5.8.8/bin/perl -wMstrict -e 'sub isa { goto \&UNIVERSAL::isa } $ /usr/local/perl/5.6.2/bin/perl -wMstrict -e 'sub isa { goto \&UNIVERSAL::isa } $ /usr/local/perl/5.4.5/bin/perl -wMstrict -e 'sub isa { goto \&UNIVERSAL::isa } -- Close the world, txEn eht nepO. |
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10On Wed, Nov 07, 2007 at 08:23:32AM -0800, Jerry D. Hedden wrote:
==19376== else { if (!cv || !CvPADLIST(cv)) Line 11808 is sv = *av_fetch(av, targ, FALSE); I assume that it's returning NULL, but I don't want to blindly patch it as a: why is this the first time where it's returned NULL? This is just about the SEGV. I don't know about the unitialised warning Nicholas Clark |
From @jdheddenJerry D. Hedden wrote:
Sébastien Aperghis-Tramoniwrote:
I'll grant you that the bug is not new to 5.10.0. However, What do you mean by 'in this case probably normal'? |
From @jdheddenJerry D. Hedden wrote:
The following (attached) evokes the above: #!/usr/bin/perl use strict; { my @foo = (); my $isa = \&UNIVERSAL::isa; *UNIVERSAL::isa = sub UNIVERSAL::isa({}, undef); Under 5.10.0, it produces: Use of uninitialized value @foo in goto at goto_bug3.pl line 19. Under 5.8.8, it produces: Use of uninitialized value in goto at goto_bug3.pl line 15. |
From @jdhedden |
From @iabynOn Wed, Nov 07, 2007 at 07:18:01PM +0000, Nicholas Clark wrote:
Hmm, what is happening is that the "use of uninit" warning occurs within MAIN: { The XS code sees the pad and CV of PL_main_cv rather than that of This causes the guessing code to go around poking into the wrong pads, I will have to think about how to deal with this. It's too late to ponder now, will worry about it another day.
Isn't this just because the second arg to isa() is undef??? -- |
From @jdhedden
I don't think so. The following is doesn't produce any perl -e 'my $x; UNIVERSAL::isa(\$x, undef)' However, the following: perl -we 'my $x; UNIVERSAL::isa(\$x, undef)' produces: Use of uninitialized value in subroutine entry at -e line 1. |
From chromatic@wgz.orgOn Wednesday 07 November 2007 16:27:41 Jerry D. Hedden wrote:
You appear to have proven that not enabling warnings disables the undef -- c |
From @jdheddenJerry D. Hedden wrote:
chromatic wrote:
Sorry, I guess I cut off too much from the previous message. I added the part about the warning because it seemed |
From @iabynOn Wed, Nov 07, 2007 at 07:27:41PM -0500, Jerry D. Hedden wrote:
I don't follow you at all. Ignoring for the moment the segfault, which I a) enable warnings and b) pass an uninitialised value, you, err, get an uninitialised value warning. What's buggy about that ???? -- |
From @iabynOn Wed, Nov 07, 2007 at 08:02:09PM -0500, Jerry D. Hedden wrote:
The undef value generates a warning. Due to a bug in the variable naming Are we now agreed that the segfault is the only thing that's buggy? -- |
From @jdheddenDave Mitchell wrote:
I still don't understand why the warning is generated. The following: #!/usr/bin/perl use strict; my $x; produces: Use of uninitialized value in subroutine entry at ./bug2.pl line 7. However, this doesn't produce any warnings: #!/usr/bin/perl use strict; sub test { my $x; Passing undef to a subroutine is permitted. Why does passing undef to |
From @tonycozOn Wed, Nov 07, 2007 at 09:48:07PM -0500, Jerry D. Hedden wrote:
UNIVERSAL::isa() uses the values you supply to it. If your test() Since UNIVERSAL::isa() is XS the undef warning is displayed for the Tony |
From @jdheddenJerry D. Hedden wrote:
Here's more "proof" of this bug. This: perl -we 'my $x; UNIVERSAL::isa(\$x, undef)' produces: Use of uninitialized value in subroutine entry at -e line 1. However, this: perl -we 'UNIVERSAL::isa(undef, "foo")' and this: perl -we 'UNIVERSAL::isa(undef, undef)' don't produce any warnings. My conclusion is that the warning: Use of uninitialized value in subroutine entry at -e line 1. is not criticizing the use of undef in the subroutine call, With all of this so far, I've encountered the following 1. Warning referencing bogus variable: Use of uninitialized value @foo in goto ... 2. Warning about subroutine entry: Use of uninitialized value in subroutine entry ... 3. Seg fault Whether or not these are all separate bugs, or two bugs (1 |
From zefram@fysh.orgJerry D. Hedden wrote:
Yes.
No. It's not an error to pass undef to a subroutine, in general. It *is* -zefram |
From @jdheddenZefram wrote:
Okay. Thank you all for putting up with me on this. After Looking in the code for UNIVERSAL::isa: XS(XS_UNIVERSAL_isa) if (items != 2) SvGETMAGIC(sv); if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv)) name = SvPV_nolen_const(ST(1)); ST(0) = boolSV(sv_derived_from(sv, name)); I determined that the line: name = SvPV_nolen_const(ST(1)); is the source of the warning. (Ya learn something new every |
From ben@morrow.me.ukQuoth tony@develop-help.com (Tony Cook):
How easy would it be to change the warning to 'use of uninitialized Ben |
From @iabynOn Thu, Nov 08, 2007 at 12:13:05AM +0000, Dave Mitchell wrote:
I've decided the simplest and safest approach for 5.10.0 is just to pre-patch: $ ./perl -we 'my $x; $x->()' post-patch: $ ./perl -we 'my $x; $x->()' This is just reverting to 5.8.x behaviour. I think a proper fix would be too complex for the near-code-freeze. -- Change 32247 by davem@davem-pigeon on 2007/11/09 00:56:20 [perl #47233] Core dump caused by goto Affected files ... ... //depot/perl/sv.c#1440 edit Differences ... ==== //depot/perl/sv.c#1440 (text) ==== @@ -12091,10 +12091,18 @@ case OP_RV2SV: + case OP_ENTERSUB: ==== //depot/perl/t/lib/warnings/9uninit#16 (text) ==== @@ -1069,8 +1069,8 @@ |
From @obraOur behavior is once-again identical to 5.8.8. Resolving. |
@obra - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#47233 (status was 'resolved')
Searchable as RT47233$
The text was updated successfully, but these errors were encountered: