DB / Linux / 6
CRITICAL
Linux SIGABRT (Abort Signal)
SIGABRT (Signal 6) is sent to a process to cause abnormal termination, typically triggered by the abort() function when the program detects a fatal error or assertion failure that cannot be recovered from.
Common Causes
- Failed assertion in code (assert() function call)
- Memory corruption detected by runtime (double free, buffer overflow)
- C++ std::terminate() or uncaught exception
- Library or runtime environment detecting unrecoverable state
- Manual triggering via kill -6 or raise(SIGABRT)
How to Fix
1 Analyze Core Dump
Enable core dumps and use gdb to examine the stack trace at crash time.
BASH
$ ulimit -c unlimited
gdb /path/to/executable core
# In gdb: bt (for backtrace) 2 Check Application Logs
Examine application logs for abort messages or failed assertions before the crash.
BASH
$ journalctl -xe | grep -A 10 -B 5 "SIGABRT\|abort"
# Or check application-specific log files 3 Run with Debugger
Run the program under gdb to catch the abort signal and get immediate debugging context.
BASH
$ gdb --args /path/to/program args
# In gdb: run
# When crash occurs: bt full 4 Check for Memory Issues
Use tools like Valgrind to detect memory corruption that could trigger SIGABRT.
BASH
$ valgrind --leak-check=full --show-leak-kinds=all /path/to/program args 5 Handle Signal Programmatically
For development, install a signal handler to catch SIGABRT and log additional context before exit.
BASH
$ #include <signal.h>
#include <stdio.h>
void handler(int sig) {
fprintf(stderr, "SIGABRT caught, performing cleanup\n");
// Custom cleanup
exit(1);
}
signal(SIGABRT, handler);