Linux system errors
Linux 139 Segmentation Fault Exit
Segmentation Fault Exit — the process terminated due to a SIGSEGV signal
What 139 Means
The 139 error on the Linux system errors indicates segmentation fault exit — the process terminated due to a sigsegv signal. This typically occurs due to null pointer dereference in a compiled binary.
Exit code 139 equals 128 + 11 (SIGSEGV). When a process is killed by a signal, the shell reports the exit status as 128 plus the signal number. This is the most common manifestation of a segmentation fault as seen by shell scripts and CI pipelines.
Technical Background
Exit code 139 is the standard shell representation of a SIGSEGV termination. The Bash convention of adding 128 to the signal number allows scripts to distinguish between a program that exited voluntarily with a non-zero code and one that was killed by a signal.
Debugging a 139 exit typically requires enabling core dumps (via ulimit -c unlimited) and then loading the resulting core file into a debugger. The debugger's backtrace reveals the call stack at the moment of the illegal memory access.
Common Causes
- Null pointer dereference in a compiled binary
- Stack overflow from excessive recursion depth
- Use-after-free or double-free memory corruption
Typical Scenarios
- A CI pipeline reports exit code 139 after a test binary crashes during execution
- A Docker container terminates with code 139 because the application inside had a memory access violation
What to Know
Enabling core dump generation before reproducing the crash provides the data needed for effective analysis. Without a core file, the backtrace information is lost and diagnosis becomes significantly harder.
Frequently Asked Questions
Common questions about Linux 139 error
In practice, yes. Exit code 139 corresponds to signal 11 (SIGSEGV), which is the segmentation fault signal. It is extremely rare for a program to deliberately exit with code 139 for another reason.