From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.2.1) Gecko/20030225 Description of problem: sigprocmask is setting the signal mask even though an invalid how is sent to the kernel. Most programs do not use invalid how parameters, but setting the mask is unexpected. I read through the glibc code and it looks like a straight pass through to the kernel. Version-Release number of selected component (if applicable): kernel-2.4.20-13.9 How reproducible: Always Steps to Reproduce: 1. Compile and run the following program: #include <stdio.h> #include <signal.h> int main(void) { sigset_t actl, oactl; sigemptyset(&actl); sigemptyset(&oactl); sigaddset(&actl, SIGABRT); sigprocmask(SIG_SETMASK, &actl, NULL); // init mask to just SIGABRT sigaddset(&actl, SIGALRM); if (sigprocmask(20000, &actl, NULL) != -1) { perror("sigprocmask() did not fail even though invalid how parameter was passed to it.\n"); return 1; } sigprocmask(SIG_SETMASK, NULL, &oactl); // read mask if (sigismember(&oactl, SIGALRM) == 1) { printf("FAIL: SIGALRM was set even though how is bad. \n"); return 1; } return 0; } Actual Results: FAIL: SIGALRM was set even though how is bad. Expected Results: No printout from program
Hmm indeed the SUS spec says it needs to return -EINVAL; investigating
Created attachment 91956 [details] Patch to fix the problem I also sent this patch to Linus.