DescriptionTesting si_pid to determine if a signal was sent by another process with a signal like kill() isn't always right. The si_pid field is valid only when the signal was actually sent by a process (either with a syscall like kill() or, for SIGCHLD, by exiting). In particular, on Linux it overlaps with the si_addr field, so an actual crash will often have nonzero si_pid. I think what we actually want to do is test si_code; the Linux kernel reserves positive values for kernel-generated signals (and this is also specified by XSI, more or less — see the application usage section of http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html ). I'm not sure if my patch does the right thing for the SysRq SIGABRT case; if someone has a pointer to the kernel code that generates it, that would help. Patch Set 1 #
MessagesTotal messages: 1
|