-
Notifications
You must be signed in to change notification settings - Fork 560
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
SEGV caused by isLEXWARN_off while PL_curcop is NULL(gp_free vs dounwind). #15435
Comments
From @hkobaCreated by @hkobaI found following script causes SEGV, in perl5.22 ~ blead 59a08c7 perl -e 'open my $fh, ">", \ (my $buf = ""); my $sub = eval q|sub {die}|; $sub->()' (gdb) run -Ilib -e 'open my $fh, ">", \ (my $buf = ""); my $sub = eval q|sub {die}|; $sub->()' Perl Info
|
From @cpansproutOn Sun Jul 10 20:00:12 2016, hkoba@cpan.org wrote:
Bisect: 96d7c88 is the first bad commit [perl #57512] Warnings for implicitly closed handles -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgFather Chrysostomos via RT wrote:
The crash is dependent on both $fh and $sub being lexical variables, Is there perhaps a reference to $sub on the context stack, which -zefram |
From @cpansproutOn Mon Jul 11 10:53:15 2016, zefram@fysh.org wrote:
I don’t think the context stack is related per se. It probably has to do with the current cop being freed. op.c:S_cop_free sets PL_curcop to NULL if it points to the cop being freed. If the $sub is freed first, then the statement containing the ‘die’, which PL_curcop still points to, gets freed, and PL_curcop is set to NULL. Then $fh is freed, which tries to check the warning flags, but I don’t know why. I have not confirmed any of this. It also does not explain why the eval is necessary. I suspect any warning that can happen during freeing could result in a similar crash. (Are there any other such warnings?) -- Father Chrysostomos |
From zefram@fysh.orgFather Chrysostomos via RT wrote:
The added code in gv.c checks whether I/O warnings are enabled as part
Without it, the sub is additionally referenced by the anoncode op in the
Good question. I'd also like to question why the I/O closure warning -zefram |
From @cpansproutOn Mon Jul 11 13:15:13 2016, zefram@fysh.org wrote:
I do not see any other warnings (in [shag].c and pad.c) except things that indicate internal inconsistency, such as ‘Attempt to free unreferenced glob pointers’.
This is one of the inherent problems with trying to warn during scope exit. Which scope is active? In this particular case, no scope is active, so $^W applies. This is one reason why use warnings FATAL => 'io::whatever'; is not a reliable way to fatalise this warning, though people have requested such a feature. I don’t know the solution to that particular problem. -- Father Chrysostomos |
From zefram@fysh.orgFather Chrysostomos via RT wrote:
Whether a particular I/O handle should be warned for, upon implicit -zefram |
From @cpansproutOn Sun Jul 10 20:00:12 2016, hkoba@cpan.org wrote:
Thank you. I have fixed the crash in commit a2637ca. -- Father Chrysostomos |
From @cpansproutOn Mon Jul 11 15:35:54 2016, zefram@fysh.org wrote:
I have opened ticket #128597 for that. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'pending release' |
From @hkobaHi! Thank you all for discussion and quickly solving this issue. Would this patch be merged to maintenance release of 5.22 and 5.24 too? (If it takes some months, I need to file this issue&patch to Thank you. On 2016-7月-11 月 17:16:18, sprout wrote:
|
From @cpansproutOn Tue Jul 12 21:09:07 2016, hkoba@cpan.org wrote:
I have proposed it. It requires the votes of two other committers.
It looks as though it will be soon: http://perl5.git.perl.org/perl.git/commit/e94880707b4983968cb376474e3570790e71c109
-- Father Chrysostomos |
From @hkobaThank you for your proposal for merging I love to hear such efforts made by you perl5-porters Thank you! On 2016-7月-15 金 13:11:22, sprout wrote:
|
From @xsawyerxOn Sat Jul 16 23:01:11 2016, hkoba@cpan.org wrote:
Thank you for your valuable contribution in improving perl! :) |
From @cpansproutOn Sat Jul 16 23:01:11 2016, hkoba@cpan.org wrote:
I’m afraid the fix came too late. It will not be included in 5.14.1. You may want to go ahead and patch perl yourself. -- Father Chrysostomos |
From @hkobaOh, ok. Thank you for informing me about this. :bow: On 2016-7月-22 金 09:14:50, sprout wrote:
|
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.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#128597 (status was 'resolved')
Searchable as RT128597$
The text was updated successfully, but these errors were encountered: