diff options
author | David Mitchell <davem@iabyn.com> | 2019-11-11 14:03:41 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-11-18 09:34:40 +0000 |
commit | ddb513d51f5efcde057dad7932a56643647947e1 (patch) | |
tree | 22422f506519f87ae5e441455b75f96aa5ff950f /mg.c | |
parent | 8a5e470b690b1c90c7332e613ada153af5547505 (diff) | |
download | perl-ddb513d51f5efcde057dad7932a56643647947e1.tar.gz |
fix unsafe signals under exceptions
The preceding commit flagged up an existing bug, but kept old the buggy
behaviour. This commit fixes the bug. I haven't added a test, since it
seems that the test suite doesn't try with unsafe signals. But this
code:
$SIG{USR1} = sub { $gotit++, die };
eval { kill SIGUSR1, $$ } for 1..2;
print "gotit=$gotit\n";
when run before erroneously gave 1, but now correctly gives 2.
Basically the code that restores the signal mask after a sig handler
dies, should do it only in a direct (unsafe) signal handler: the
deferred (safe) signal handler will have already done it. The bug was
that the inbuilt perl unsafe signal handler was being incorrectly
treated as safe. The code path via POSIX (and for which a test was added
with v5.13.9-531-gc22d665b55) *was* ok.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1539,7 +1539,7 @@ Perl_csighandler(int sig) * rather than via Perl_sighandler, passing the extra * 'safe = false' arg */ - Perl_perly_sighandler(sig, NULL, NULL, 1 /* XXX tmp safe */); + Perl_perly_sighandler(sig, NULL, NULL, 0 /* unsafe */); else #ifdef PERL_USE_3ARG_SIGHANDLER (*PL_sighandlerp)(sig, NULL, NULL); |