When does a process get SIGABRT (signal 6)?

Shree picture Shree · Aug 5, 2010 · Viewed 378k times · Source

What are the scenarios where a process gets a SIGABRT in C++? Does this signal always come from within the process or can this signal be sent from one process to another?

Is there a way to identify which process is sending this signal?

Answer

Nordic Mainframe picture Nordic Mainframe · Aug 5, 2010

abort() sends the calling process the SIGABRT signal, this is how abort() basically works.

abort() is usually called by library functions which detect an internal error or some seriously broken constraint. For example malloc() will call abort() if its internal structures are damaged by a heap overflow.