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.
In reply to Re^3: Setting signal handlers considered unsafe?
by gone2015
in thread Setting signal handlers considered unsafe?
by gnosek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |