What are the general causes of abort signal?

Mandar picture Mandar · Apr 20, 2011 · Viewed 10k times · Source

I have an application, in C++ over running linux, which on exit gets abort signal. Before 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

Answer

Bruce picture Bruce · Apr 20, 2011
  • 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...