Skip Menu |

This queue is for tickets about the Eval-WithLexicals CPAN distribution.

Report information
The Basics
Id: 72767
Status: rejected
Priority: 0/
Queue: Eval-WithLexicals

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.002000
Fixed in: (no value)



Subject: Bleadperl v5.15.4-401-gf45b078 breaks DGL/Eval-WithLexicals-1.002000
As per subject Bisecting leads to f45b078d20e995d83ee8428c8f199c0e6eca92f9 is the first bad commit commit f45b078d20e995d83ee8428c8f199c0e6eca92f9 Author: Father Chrysostomos <sprout@cpan.org> Date: Wed Nov 16 18:18:23 2011 -0800 [perl #70151] eval localises %^H at runtime It doesn’t any more. HTH, Thanks && Regards,
I’m having difficulty figuring out what this module is doing. If someone could explain it briefly, I could probably figure out more quickly why it’s failing.
Andreas, is this the same failure you are getting? $ perl5.15.6 -Mblib t/hints.t ok 1 - Basic non-strict eval ok ok 2 - Lexical not stored ok 3 - Unable to use undeclared variable not ok 4 - Correct message in $@ # Failed test 'Correct message in $@' # at t/hints.t line 28. # 'Variable "$x" is not imported at (eval) line 2. # ' # doesn't match '(?^:requires explicit package)' ok 5 - Hints are set per strictures ok 6 - Lexical not stored ok 7 - Lexical pragma used below main scope not captured ok 8 - Lexical pragma captured 1..8 # Looks like you failed 1 test of 8. (where 5.15.6 is v5.15.6-554-gbdd2b37)
On Sat Jan 21 21:22:36 2012, SPROUT wrote: Show quoted text
> I’m having difficulty figuring out what this module is doing. If > someone could explain it briefly, > I could probably figure out more quickly why it’s failing.
mst: I’ve just figured out how you append to code that is currently being compiled. How on earth did you come up with that?!
On Sat Jan 21 21:32:23 2012, SPROUT wrote: Show quoted text
> $ perl5.15.6 -Mblib t/hints.t > ok 1 - Basic non-strict eval ok > ok 2 - Lexical not stored > ok 3 - Unable to use undeclared variable > not ok 4 - Correct message in $@ > # Failed test 'Correct message in $@' > # at t/hints.t line 28. > # 'Variable "$x" is not imported at (eval) line 2. > # ' > # doesn't match '(?^:requires explicit package)' > ok 5 - Hints are set per strictures > ok 6 - Lexical not stored > ok 7 - Lexical pragma used below main scope not captured > ok 8 - Lexical pragma captured > 1..8 > # Looks like you failed 1 test of 8.
It seems that this test: is_deeply( [ $eval->eval('$x = 1') ], [ 1 ], 'Basic non-strict eval ok' ); is causing the *x to exist for the next eval, which then emits a ‘Variable is not imported’ warning (since the *x glob exists), which, due to fatal warnings, ends up in $@ instead of the ‘Global symbol $x require explicit package’ that usually follows. I have yet to ascertain why %^H scoping has anything to do with it.
CC: ANDK [...] cpan.org
Subject: Re: [rt.cpan.org #72767] Bleadperl v5.15.4-401-gf45b078 breaks DGL/Eval-WithLexicals-1.002000
Date: Sun, 22 Jan 2012 10:27:48 +0100
To: bug-Eval-WithLexicals [...] rt.cpan.org
From: andreas.koenig.7os6VVqR [...] franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Sat, 21 Jan 2012 21:32:26 -0500, "Father Chrysostomos via RT" <bug-Eval-WithLexicals@rt.cpan.org> said:
Show quoted text
> Andreas, is this the same failure you are getting?
Yes. -- andreas
On Sat Jan 21 21:58:16 2012, SPROUT wrote: Show quoted text
> On Sat Jan 21 21:32:23 2012, SPROUT wrote:
> > $ perl5.15.6 -Mblib t/hints.t > > ok 1 - Basic non-strict eval ok > > ok 2 - Lexical not stored > > ok 3 - Unable to use undeclared variable > > not ok 4 - Correct message in $@ > > # Failed test 'Correct message in $@' > > # at t/hints.t line 28. > > # 'Variable "$x" is not imported at (eval) line 2. > > # ' > > # doesn't match '(?^:requires explicit package)' > > ok 5 - Hints are set per strictures > > ok 6 - Lexical not stored > > ok 7 - Lexical pragma used below main scope not captured > > ok 8 - Lexical pragma captured > > 1..8 > > # Looks like you failed 1 test of 8.
> > It seems that this test: > > is_deeply( > [ $eval->eval('$x = 1') ], > [ 1 ], > 'Basic non-strict eval ok' > ); > > is causing the *x to exist for the next eval, which then emits a > ‘Variable is not imported’ > warning (since the *x glob exists), which, due to fatal warnings, ends > up in $@ instead of the > ‘Global symbol $x require explicit package’ that usually follows.
In earlier perls, the ‘Variable is not imported’ warning is caught by the __WARN__ handler. Then the ‘Global symbol’ error exits the eval and ends up in $@. In bleadperl, do "string" propagates warning hints, causing fatal warnings to turn ‘Variable is not imported’ into an error: my $code = 'use strict; $x; 1'; my $text_ref = \$code; local @INC = (sub { if ($_[1] eq '/eval_do') { open my $fh, '<', $text_ref; $fh; } else { (); } }, @INC); *x; use warnings FATAL => 'all'; do '/eval_do' or die "error is [$@]"; That gives: error is [Variable "$x" is not imported at /loader/0x803a10//eval_do line 1. ] at - line 13. Arguably, Eval::WithLexicals should be producing exactly that behaviour anyway, since it should be capturing the fatals warnings from ‘use strictures 1’. So, by introducing a perl bug, I’ve introduced a case where two bugs cancel each other out. :-) I obviously need to fix the perl bug. But Eval::WithLexicals ought to be propagating ${^WARNING_BITS}, not just *^H.
On Sun Jan 22 16:52:02 2012, SPROUT wrote: Show quoted text
> I obviously need to fix the perl bug.
It’s now fixed in commit 3840c57. Show quoted text
> But Eval::WithLexicals ought to be propagating ${^WARNING_BITS}, not > just *^H.
Rejecting this as it wasn't a bug with the module.