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
Seg. fault with eval/use/UNITCHECK/DESTROY/eval combination #9970
Comments
From @AbigailCreated by @Abigail $ cat Module.pm sub DESTROY {eval ""} 1; Removing the eval in the DESTROY function, the UNITCHECK, changing Running it as valgrind -v perl -wE 'eval "use Module";' results in no errors, just a 5 byte memory leak. Perl Info
|
From @jdhedden
Under blead, and 5.10.1, Or more simply syntax error at - line 0, near "use Module." |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutThis case can be reduced to: (eval 0 triggers the bug more reliably than eval ''.) The inner eval clobbers PL_eval_start, so when the UNITCHECK finishes, The attached patch saves PL_eval_start and restores it after UNITCHECK. |
From @cpansproutInline Patchdiff -Nurp blead/pp_ctl.c blead-70614/pp_ctl.c
--- blead/pp_ctl.c 2009-12-07 05:03:09.000000000 -0800
+++ blead-70614/pp_ctl.c 2009-12-09 12:36:38.000000000 -0800
@@ -3132,8 +3132,11 @@ S_doeval(pTHX_ int gimme, OP** startop,
}
}
- if (PL_unitcheckav)
+ if (PL_unitcheckav) {
+ OP *es = PL_eval_start;
call_list(PL_scopestack_ix, PL_unitcheckav);
+ PL_eval_start = es;
+ }
/* compiled okay, so do it */
diff -Nurp blead/t/op/blocks.t blead-70614/t/op/blocks.t
--- blead/t/op/blocks.t 2009-11-19 08:51:40.000000000 -0800
+++ blead-70614/t/op/blocks.t 2009-12-09 12:39:57.000000000 -0800
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-plan tests => 3;
+plan tests => 4;
my @expect = qw(
b1
@@ -105,3 +105,7 @@ sub CHECK {print ":check"}
sub INIT {print ":init"}
sub END {print ":end"}
SCRIPT3
+
+fresh_perl_is(<<'SCRIPT70614', "still here",{switches => [''], stdin => '', stderr => 1 },'eval-UNITCHECK-eval (bug 70614)');
+eval "UNITCHECK { eval 0 }"; print "still here";
+SCRIPT70614 |
From @cpansproutOn Tue Mar 16 07:12:13 2010, sprout wrote:
Applied as 8ed4948. |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#70614 (status was 'resolved')
Searchable as RT70614$
The text was updated successfully, but these errors were encountered: