Exit Code 139 means that the process terminated with a segmentation fault (SIGSEGV) error. This occurs when trying to access an invalid memory area.
Main Causes
- Error in C/C++ code
- Incompatible or corrupted libraries
- Corrupted binary file
- Issues within the Docker container
Method 1: Enabling and Checking Core Dump
Check the current limit:
ulimit -c
If the value is 0, enable it:
ulimit -c unlimited
After the program crashes again, a core file will appear.
Method 2: Analysis via gdb
gdb ./app core
Inside gdb, execute:
bt
The bt command will show the stack trace and the point of failure.
Method 3: Checking Dependencies
ldd ./app
If lines not found are displayed, libraries need to be reinstalled.
Method 4: Reinstalling the Package
For Ubuntu/Debian:
sudo apt reinstall package-name
For CentOS:
sudo yum reinstall package-name
Conclusion
Exit Code 139 indicates a serious memory access error. Analyzing the core dump and checking dependencies help identify the source of the problem and resolve it.