-
Notifications
You must be signed in to change notification settings - Fork 550
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
segfault with symbol table and coderef #15937
Comments
From @maukeCreated by @mauke$ perl -e '$::{"A"} = sub {}; \&{"A"}' I haven't done any analysis but this is the stacktrace from 5.25.11: Program received signal SIGSEGV, Segmentation fault. Perl Info
|
From @jkeenanOn Fri, 31 Mar 2017 18:15:50 GMT, mauke- wrote:
This was a regression between 5.20 and 5.22 (which I *think* means it's not a 5.26.0 blocker). Bisection command: ##### Tail of bisection result: ##### Avoid creating GVs when subs are declared :100644 100644 74f1ba990b5fec64709aa08caa4c9dd1945a2428 4378152a3db27ee3d40e8a12dec07b550541b72f M embed.fnc Confirmation via building perl at commit before and commit. What was formally an exception became a segfault. ##### [2eaf799] 509 $ ./bin/perl -v | head -2 | tail -1 Father C, can you take a look? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Fri, 31 Mar 2017 15:02:43 -0700, jkeenan wrote:
Right. One of the docs says that assigning to stash elements like that results in undefined behaviour. (It still shouldn’t crash, but there is no need for it to be a blocker.)
Patch attached. -- Father Chrysostomos |
From @cpansproutFrom ea6c8a920fe6433d6e7d190ba0e9aed4f790aaed Mon Sep 17 00:00:00 2001 $ perl -e '$::{"A"} = sub {}; \&{"A"}' The code that vivifies a typeglob out of a code ref assumed that the Inline Patchdiff --git a/gv.c b/gv.c
index d32a9c5..315ec49 100644
--- a/gv.c
+++ b/gv.c
@@ -421,7 +421,7 @@ Perl_gv_init_pvn(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, U32 flag
/* Not actually a constant. Just a regular sub. */
CV * const cv = (CV *)has_constant;
GvCV_set(gv,cv);
- if (CvSTASH(cv) == stash && (
+ if (CvNAMED(cv) && CvSTASH(cv) == stash && (
CvNAME_HEK(cv) == GvNAME_HEK(gv)
|| ( HEK_LEN(CvNAME_HEK(cv)) == HEK_LEN(GvNAME_HEK(gv))
&& HEK_FLAGS(CvNAME_HEK(cv)) != HEK_FLAGS(GvNAME_HEK(gv))
diff --git a/t/op/gv.t b/t/op/gv.t
index 8d5e7dc..4fe6b00 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -1187,6 +1187,10 @@ package GV_DOWNGRADE {
::like "$GV_DOWNGRADE::{FOO}", qr/SCALAR/, "gv_downgrade: post";
}
+# [perl #131085] This used to crash; no ok() necessary.
+$::{"A131085"} = sub {}; \&{"A131085"};
+
+
__END__
Perl
Rules |
From @cpansproutOn Fri, 07 Apr 2017 14:10:52 -0700, sprout wrote:
Now applied as 790acdd. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.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#131085 (status was 'resolved')
Searchable as RT131085$
The text was updated successfully, but these errors were encountered: