+
+ # test unsafe signal handlers in combination with exceptions
+ my $action = POSIX::SigAction->new(sub { $gotit--, die }, POSIX::SigSet->new, 0);
+ POSIX::sigaction(&POSIX::SIGALRM, $action);
+ eval {
+ alarm 1;
+ my $set = POSIX::SigSet->new;
+ POSIX::sigprocmask(&POSIX::SIG_BLOCK, undef, $set);
+ is $set->ismember(&POSIX::SIGALRM), 0, "SIGALRM is not blocked on attempt $_";
+ POSIX::sigsuspend($set);
+ } for 1..2;
+ is $gotit, 0, 'Received both signals';
+}
+
+{
+ # RT #88774
+ # make sure the signal handler's called in an eval block *before*
+ # the eval is popped
+
+ $SIG{'ALRM'} = sub { die "HANDLER CALLED\n" };
+
+ eval {
+ alarm(2);
+ select(undef,undef,undef,10);
+ };
+ alarm(0);
+ is($@, "HANDLER CALLED\n", 'block eval');
+
+ eval q{
+ alarm(2);
+ select(undef,undef,undef,10);
+ };
+ alarm(0);
+ is($@, "HANDLER CALLED\n", 'string eval');