Linux system errors
Linux 128 Invalid Exit Argument
Invalid Exit Argument — script exited with an out-of-range status or terminated by a signal
What 128 Means
The 128 error on the Linux system errors indicates invalid exit argument — script exited with an out-of-range status or terminated by a signal. This typically occurs due to shell script calling 'exit' with a value outside the valid 0-255 range.
In Linux shell conventions, exit code 128 by itself means an invalid argument was passed to the exit built-in. More commonly, exit codes 128+N (e.g., 130 = 128+2 for SIGINT, 137 = 128+9 for SIGKILL) indicate the process was terminated by signal N.
Technical Background
The POSIX exit status is an 8-bit value (0-255). The Bash convention encodes signal-terminated processes as 128+signal_number, making it possible to distinguish a normal non-zero exit from a signal kill.
Subtracting 128 from an exit code greater than 128 yields the signal number that terminated the process. The 'kill -l' command lists signal names by number, mapping the raw numeric value to a named signal such as SIGKILL or SIGTERM.
Common Causes
- Shell script calling 'exit' with a value outside the valid 0-255 range
- Process killed by a signal — the exit code is 128 plus the signal number
- Bash built-in or script wrapper returning the 128 base code on abnormal termination
Typical Scenarios
- Shell script with 'exit 256' (out of range) resulting in exit code 128
- Background job killed by the OOM Killer returning exit code 137 (128+SIGKILL)
- CI/CD pipeline reporting exit code 130 when a build process is cancelled with Ctrl+C
What to Know
Exit code 128 alone indicates a script passed an invalid value to the exit built-in. Exit codes above 128 encode signal-terminated processes using the convention 128 + signal_number, distinguishing signal kills from standard non-zero exits.
Frequently Asked Questions
Common questions about Linux 128 error
If the exit code is greater than 128, subtract 128 to get the signal number. For example, exit code 137 means the process was killed by signal 9 (SIGKILL), typically from the OOM Killer or an explicit 'kill -9' command.