At 12:07 AM 11/9/2001 -0500, Michael G Schwern wrote: >On Thu, Nov 08, 2001 at 11:03:45PM -0600, Craig A. Berry wrote: >> At 10:18 PM -0500 11/8/01, Michael G Schwern wrote: >> >Running bleadperl 12907 I'm getting some failures: >> > >> >ext/POSIX/t/posix.t >> >Test #10 is disappearing, which means POSIX sigmasks are broken. >> >> Disappearing? Does that mean the test exits early with no error message? > >No, it means the masked SIGINT is never fired. > >Test #10 is only printed if a SIGINT is received.
OK, I've tried to reproduce the masking of SIGINT in C, and if I've understood what the test is trying to do and implemented it right (both somewhat iffy) we do get the SIGINT firing at the appropriate time. With Compaq C V6.4-005 on OpenVMS Alpha V7.2-1 the output of the test program below is: Caught SIGHUP should see this before SIGINT Caught SIGINT Done -- should have seen SIGINT So, if I'm on the right track, it's not the signal infrastructure that's busted but something about the way Perl uses it, perhaps in POSIX.xs or in the %SIG implementation. Can anyone comment on whether I *am* on the right track, or at least send me the output of the test program on some other system? TIA. ---- begin masksigs.c ----- #include <stdio.h> #include <signal.h> void my_sigint_routine(int); void my_sighup_routine(int); main() { sigset_t sigset, emptyset; struct sigaction my_sigint_action = { &my_sigint_routine, 0, 0 }; struct sigaction my_sighup_action = { &my_sighup_routine, 0, 0 }; int status; status = sigemptyset(&sigset); if (status) perror("The error from sigemptyset is"); status = sigaddset(&sigset, SIGINT); if (status) perror("The error from sigaddset is"); my_sighup_action.sa_mask = sigset; status = sigaction(SIGHUP, &my_sighup_action, (struct sigaction *)0); if (status) perror("The error from sigaction (SIGHUP) is"); status = sigemptyset(&emptyset); if (status) perror("The error from sigemptyset is"); my_sigint_action.sa_mask = emptyset; status = sigaction(SIGINT, &my_sigint_action, (struct sigaction *)0); if (status) perror("The error from sigaction (SIGINT) is"); raise(SIGHUP); sleep(1); printf("Done -- should have seen SIGINT\n"); } void my_sighup_routine(int x) { switch (x) { case SIGHUP: printf("Caught SIGHUP\n"); raise(SIGINT); sleep(2); printf("should see this before SIGINT\n"); break; default: printf("Unexpected signal: %d\n", x); break; } } void my_sigint_routine(int x) { switch (x) { case SIGINT: printf("Caught SIGINT\n"); break; default: printf("Unexpected signal: %d\n", x); break; } } ---- end masksigs.c -----