in reply to Re^2: Setting signal handlers considered unsafe?
in thread Setting signal handlers considered unsafe?
I tweaked you code a little to get a view of what was happening:
and the result was:my $rcvd = 0 ; # added counter for signals seen in eval's handle +r sub wrap_sigs { ... eval { for my $sig (keys %$signals) { $old_sighandlers{$sig} = ($SIG{$sig} || 'DEFAULT'); $SIG{$sig} = sub { $rcvd++ ; die ("SIG $sig $rcvd\n") }; ...
1..1 # parent entering wrap_sigs loop # child starting signal storm SIG ALRM 5 # Looks like your test died before it could output anything.from which I conclude that a number of ALRM signals were trapped in the eval, but eventually Perl left eval state, with the die handler still set.
Running the thing a number of times I got quite a wide range of numbers of ALRM signals swallowed while in the eval.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
[WORKAROUND] Re^4: Setting signal handlers considered unsafe?
by gnosek (Sexton) on Nov 07, 2008 at 17:53 UTC | |
by gone2015 (Deacon) on Nov 07, 2008 at 21:47 UTC |