Search code examples
unixcrashgdbsignalscoredump

Finding Source of a UNIX Signal from Coredump


This has been long pending question in my mind. I see that GDB tells us the signal causing process termination.

How do I find the source of the signal from a core?

In two different occasions my two application received SIGEMT and SIGUSR1. I know that there are other applications in production which can send these signals.

Also, I know that the sender information can be seen within running program and the data would be present in siginfo_t structure. But I don't have that luxury and in fact we don't have handler for this signal at all.


Solution

  • Recent-enough versions of the Linux kernel store this information in the core file. And, recent-enough versions of gdb can read it. Then you can use print $_siginfo with a core file just as you would when debugging live.