$RodHat_/search
exit code reference

Exit 139 SIGSEGV (128 + 11)

Segmentation fault: the process touched memory it does not own.

Value
139
Convention
Killed by a signal (128 + N)
Signal
SIGSEGV (Linux 11, FreeBSD 11)

A bad pointer, a use-after-free, a stack overflow, or a null dereference. The shell prints "Segmentation fault", and with core dumps enabled "(core dumped)". Build with -g, turn on core dumps, and read the backtrace; AddressSanitizer will usually name the line.

What to check

ulimit -c unlimited; ./prog; gdb ./prog core

Sources

  1. Exit Status, GNU Bash manual
  2. signal(7), Linux man-pages

Exit codes are conventions, not guarantees: a program can return any value from 0 to 255. Spot one that's wrong? Tell Rod.