C++ Linux Binary terminated with signal SIGKILL - why? (loaded in GDB)

I literally have no idea why this is occuring,

This usually means that either

  • some other process executed a kill -9 <your-pid>, or
  • the kernel OOM killer decided that your process consumed too many resources, and terminated it (effectively the kernel executed kill -9 for it). You should look in /var/log/messages (/var/log/syslog on Ubuntu variants) for traces of that -- the kernel usually logs a message when it OOMs some process.

why can't I do a backtrace to see how it exited?

Because in order to see a backtrace, the process must exist. If it doesn't exist, it doesn't have stack, and so can't have backtrace.


If you are using Unix/Linux you should also be able to type dmesg on your terminal and see the cause of the process terminating. In my case it was indeed OOM. here is a screenshot of my kernel log shortly after the termination

Tags:

C++

Ubuntu

Gdb