LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Logging Signals sent to processes (https://www.linuxquestions.org/questions/linux-general-1/logging-signals-sent-to-processes-780789/)

gagan_goku 01-08-2010 03:15 AM

Logging Signals sent to processes
 
Hi

Is there a way of tracking what signals are sent to a process? Something fishy is happening with one of the programs im running:

Program X somehow gets a SIGSEGV. It has signal handler that should (in theory) catch the signal and start dumping the stack trace. I have verified that it works when i manually send it SIGSEFV (via kill -SEGV)
However, somewhere down the line while serving traffic, the process dies without a single line of trace in its log. Somehow in the log of the parent process, i see a process terminated segmentation fault. But why the process dies without a stack trace is beyond me.

What i would like to know is, is there a way of tracking signals being sent to processes. For example, if the kernel could somehow log all uses of the signal / raise system call, i could know that it sent SIGKILL to my process (which caused X to die before printing stack trace), or that it didn't and the problem lies elsewhere.

macemoneta 01-08-2010 12:27 PM

You can use strace with '-e trace=signal'. I think that should do what you want.


All times are GMT -5. The time now is 07:04 AM.