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

So I fire up my c++ application in GDB, and when it quits, I basically get:

[Thread 0x7fff76e07700 (LWP 6170) exited]
[Thread 0x7fff76f08700 (LWP 6169) exited]
[Thread 0x7fff77009700 (LWP 6168) exited] 
...
Program terminated with signal SIGKILL, Killed. The program no longer exists.
(gdb)

I literally have no idea why this is occuring, why can't I do a backtrace to see how it exited? Anyone have any ideas? It should never end :(

Thanks!



Solution 1:[1]

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

Solution 2:[2]

It is possible that the process ran into the cpu time ulimit. Check with ulimit -a from the environment where the process is actually started if "cpu time" is set to anything other than "unlimited"

Solution 3:[3]

In my case was a crash (AV). Even with GDB attached I couldn't catch this violation.
Hope it helps

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stephen Pleros
Solution 2 ulimit
Solution 3 vlg789