开发者

What are the general causes of abort signal?

I have an application, in C++ over running linux, which on exit gets abort signal. Bef开发者_JS百科ore I go after the code to hunt down the problem, I need to know what could be the cases in which I shall get an abort signal from kernel. This could give me proper direction to debug.

Please mention each and every potential scenario in which an application could get an abort signal.

@ specifics of execution scenario are,

  • process is in exit mode, i.e exit() routine is called for graceful shutdown of process.
  • consequently all the global object destructors are called.

TIA


  • Compile it with -g
  • Run it from a debugger

When the application crashes, the debugger will give you the line, let you inspect thread, variables...

Other solution:

  • change your core dump generation with ulimit
  • load the core dump in gdb post mortem

Root cause can be multiple : reading outside of your memory space, division by 0, dereferencing invalid pointer...


I would try running under valgrind. There could be a memory error even before the abort and valgrind could notice that and tell you. If this is the case, you will find the error much easier than with a conventional debugger like gdb.


The cause for aborted is in general an assertion failure

for example

(gdb) bt
#0  0x00000035fbc30265 in raise () from /lib64/libc.so.6
#1  0x00000035fbc31d10 in abort () from /lib64/libc.so.6
#2  0x00000035fbc296e6 in __assert_fail () from /lib64/libc.so.6
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜