We are using the standard pattern of registering custom signal handler for SIGSEGV with sigaction and then when segmentation fault occurs using the backtrace function to walk the stack and print it to some file. It is nice feature to have the backtrace in logs but it disables the OS writing the full dump of the crashed program which is
Tag: sigaction
Catching SIGSEGV when triggered by corrupt stack
I’ve been working on some buggy code and wanted to install a SIGSEGV handler to get more information about the crash. However, I noticed that my handler is not invoked. I’ve been looking for a reason and it seems it has to do with a corrupt stack pointer value (it’s not getting masked for sure). Here’s some proof-of-concept code I
sigaction’s signal handler not called in child process
I’ve a program, which installs a signal handler for SIGSEGV. In signal handler ( I try to catch crash ) I restart my application. But when my application is resurrected it doesn’t handle SIGSEGV anymore. Here’s an example: what I get in output is: So I can see sighandler was set in right way, but resurrected app simply crashed silently.