Description of problem: The fedora kernel seems to break signal-handling with dietlibc. E.g. the following trivial program causes a segfault: ------ #include <sys/signal.h> void handler(int s) {} int main() { signal(SIGUSR1, handler); kill(getpid(), SIGUSR1); } ------ | $ diet gcc test.c | $ strace ./a.out | execve("./a.out", ["./a.out"], [/* 26 vars */]) = 0 | rt_sigaction(SIGUSR1, {0x80480d4, [USR1], SA_NOMASK}, {SIG_DFL}, 8) = 0 | getpid() = 31173 | kill(31173, SIGUSR1) = 0 | --- SIGUSR1 (User defined signal 1) @ 0 (0) --- | --- SIGSEGV (Segmentation fault) @ 0 (0) --- | +++ killed by SIGSEGV +++ This issue is caused by the fedora kernel; with a vanilla 2.6.8.1 kernel or 2.4.27 things are fine: | $ strace ./a.out | execve("./a.out", ["./a.out"], [/* 37 vars */]) = 0 | rt_sigaction(SIGUSR1, {0x80480d4, [USR1], SA_NOMASK}, {SIG_DFL}, 8) = 0 | getpid() = 1366 | kill(1366, SIGUSR1) = 0 | --- SIGUSR1 (User defined signal 1) @ 0 (0) --- | sigreturn() = ? (mask now []) | _exit(0) = ? Version-Release number of selected component (if applicable): kernel-2.6.8-1.521 dietlibc-0.24-4 How reproducible: 100%
dietlibc is miscompiled I suspect; it needs to indicate in the elf flags that it requires executable stack.
it happens also when the program is compiled with | diet gcc x.c -Wl,-z -Wl,execstack or with LD_ASSUME_KERNEL=2.2.5.
Fixed in dietlibc-0.27-3. Added i386 sigaction code very similar to the x86_64 sigaction code (basically, ensuring that the restorer is set to sigreturn)
Mass-closing lots of old bugs which are in MODIFIED (and thus presumed to be fixed). If any of these are still a problem, please reopen or file a new bug against the release which they're occurring in so they can be properly tracked.