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
Signal arrival resets $@ #9019
Comments
From amashanov@masterhost.ruSignal arrival resets $@ #! /usr/bin/perl use strict; $SIG{HUP} = sub{}; eval{ Perl Info
|
From jtobey@bierce.john-edwin-tobey.orgThis is a bug report for perl from jtobey@bierce.john-edwin-tobey.org, Signal handlers affect the value of $@ even when they don't use eval/die. The following program prints "Signal clobbers $@!" I believe it should $SIG{'INT'} = sub { if ($before ne $after) { Flags: Site configuration information for perl 5.10.0: Configured by jtobey at Wed Nov 28 13:39:07 EST 2007. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Locally applied patches: @INC for perl 5.10.0: Environment for perl 5.10.0: |
From jtobey@john-edwin-tobey.orgThis ticket should say: Severity: High This bug will spookily generate false positive eval results in any To fix this bug and restore the pre-5.8 behaviour, make In other words, Perl_sighandler() needs to do the C equivalent of: my $err; instead of the current: eval ...; By the way, unfriendly RT rejects my edits: * Could not add new custom field value: Permission Denied |
From [Unknown Contact. See original ticket]This ticket should say: Severity: High This bug will spookily generate false positive eval results in any To fix this bug and restore the pre-5.8 behaviour, make In other words, Perl_sighandler() needs to do the C equivalent of: my $err; instead of the current: eval ...; By the way, unfriendly RT rejects my edits: * Could not add new custom field value: Permission Denied |
From @jbenjoreOn Dec 10, 2007 2:50 PM, John Tobey via RT <perlbug-comment@perl.org> wrote:
Two things. I see nothing wrong with my results of running your $@= $@ can be false after error because an eval{} happened during a ->DESTROY. In general you must always examine the result of eval{} to see if the Josh |
The RT System itself - Status changed from 'new' to 'open' |
From jtobey@john-edwin-tobey.orgOn Tue Dec 11 01:38:04 2007, jjore wrote:
Please refer to the example in the original bug report, not the You have to meditate a little to appreciate the bug. If your program Example: $SIG{ALRM} = sub { $got_ALRM = 1; }; ### ALRM SIGNAL HERE CLEARS $@ print("error:$@"); The fix is simple but requires changes to Perl_sighandler() in mg.c. By the way, though it's irrelevant to the bug, several places in the Regards, |
From @jbenjoreOn Dec 11, 2007 9:00 AM, John Tobey via RT <perlbug-followup@perl.org> wrote:
Until proven otherwise, all those places are bugs. It's true that in Josh |
From root@mail.nethype.deCreated by root@mail.nethype.de$@ is being cleared by signal handlers: perl -e '$SIG{INT}=sub{}; should give me 5, but "gives" me undef. this means that it is virtually impossible to use signal handlers for There also seems to be no way to preserve $@ from perl as well. I think perl should preserve $@, at least as long as the signal handler Perl Info
|
From p5p@spam.wizbit.be
Binary search: ----Program---- $SIG{INT}=sub{}; ----Output of ...l/pZGlxCF/perl-5.7.0@8405/bin/perl---- ----EOF ($?='0')---- ----EOF ($?='0')---- http://perl5.git.perl.org/perl.git/commit/ Integrate perlio: [ 8408] [ 8407] p4raw-link: @8408 on //depot/perlio: p4raw-id: //depot/perl@8409 http://perl5.git.perl.org/perl.git/commit/ Catch die in %SIG handler and unblock the signal before re-dying. p4raw-id: //depot/perlio@8407 |
From [Unknown Contact. See original ticket]
Binary search: ----Program---- $SIG{INT}=sub{}; ----Output of ...l/pZGlxCF/perl-5.7.0@8405/bin/perl---- ----EOF ($?='0')---- ----EOF ($?='0')---- http://perl5.git.perl.org/perl.git/commit/ Integrate perlio: [ 8408] [ 8407] p4raw-link: @8408 on //depot/perlio: p4raw-id: //depot/perl@8409 http://perl5.git.perl.org/perl.git/commit/ Catch die in %SIG handler and unblock the signal before re-dying. p4raw-id: //depot/perlio@8407 |
p5p@spam.wizbit.be - Status changed from 'new' to 'open' |
From [Unknown Contact. See original ticket]Fixed in 100c03a. |
@doy - Status changed from 'new' to 'resolved' |
From @wolfsageAs of 5.17.6 (and current blead) this appears to work once again as Can this be closed or would we like a bisect of what fixed it? -- Matthew Horsfall (alh) |
From [Unknown Contact. See original ticket]As of 5.17.6 (and current blead) this appears to work once again as Can this be closed or would we like a bisect of what fixed it? -- Matthew Horsfall (alh) |
From @wolfsageOn Fri, Jun 21, 2013 at 3:24 PM, Matthew Horsfall via RT <
Got my answer from a different thread. Bisecting preferred, I'll try to run -- Matthew Horsfall (alh) |
From @nwc10On Fri, Jun 21, 2013 at 03:44:13PM -0400, Matthew Horsfall (alh) wrote:
I'm already running one. I thought that it would be easy, but it confused me ./perl -e '$SIG{INT}=sub{}; not ./perl -e '$SIG{INT}=sub{}; as the latter kills the process group which includes bisect-runner.pl, Nicholas Clark |
From @nwc10On Fri, Jun 21, 2013 at 08:53:45PM +0100, Nicholas Clark wrote:
bisect.pl --expect-fail -e '$SIG{INT}=sub{}; says: 100c03a is the first bad commit don't let arriving signals reset $@ [perl #45173] since signals can arrive at any point, clearing $@ isn't a safe :100644 100644 8cfee10824803ce2617d7700901d8361207cc115 14965da0a895b8fc0d611a6880efb954f2d9ee20 M mg.c I could probably have got the answer faster by adding --target=miniperl For these bugs which have clear concise test cases, it's a shame that we I've merged this ticket into #45173 which I think has the side effect of Again, thanks for digging into RT and finding things which we can close. Nicholas Clark |
From @nwc10On Fri, Jun 21, 2013 at 09:23:04PM +0100, Nicholas Clark wrote:
And for the benefit of all those tickets, the bug appears to have been commit 1b26641 Catch die in %SIG handler and unblock the signal before re-dying. :100644 100644 ca06b891fca0d1d62a40b8455af823e8ace9d82c a7566e3e9451c109f27a9599a28f1044c86c54f0 M mg.c Nicholas Clark |
From @khwilliamsonOn 06/21/2013 02:23 PM, Nicholas Clark wrote:
Me too. But for people who are reading this and want to contribute to Perl This url lists all the tickets that have patches, though I think it misses some. |
Migrated from rt.perl.org#45173 (status was 'resolved')
Searchable as RT45173$
The text was updated successfully, but these errors were encountered: