C++ program crashes with EXIT CODE: 9 (SIGKILL)

前端 未结 1 1474
旧巷少年郎
旧巷少年郎 2021-02-19 01:22

My application program crashes with EXIT CODE: 9 (SIGKILL)

I never run any command such as \'kill -9 (pid)\' or \'pkill (process name)\' that can kill the running proces

1条回答
  •  悲&欢浪女
    2021-02-19 02:22

    @ I answer my own question so that some one can get helps later.

    The exception was caused by OutOfMemory.

    The process allocates too much memory putting pressures on OS. The OS has a hit man, oom-killer, that kills such processes for the sake of system stability. The oom-killer uses bullets called SIGKILL.

    However, since SIGKILL is invisible (it cannot be caught and handled by the application), for some newbies including me, it is not always easy to figure out the true reason for the crash.

    One good news is that when the hit man kills your process, it always logs its action at /var/log/messages.

    Depending on your OS configuration, oom-killer might not log any message at all. In such a case, you can configure it as well. Search for rsyslog configuration in google.

    Finding which process was killed by Linux OOM killer

    0 讨论(0)
提交回复
热议问题