Linux system errors

Invalid Exit Argument

128
LowLinux System

Reviewed for reference consistency: August 11, 2026

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.

How to fix 128

General informational guidance, not professional advice. Commands can affect your system or data — back up first and proceed at your own risk. FixerCode is an independent reference, not affiliated with any vendor mentioned.

  1. Determine the signal from the exit code

    For exit codes above 128, subtract 128 to get the signal number. The kill -l command maps each number to its signal name.

    kill -l
  2. Check whether the script used an out-of-range exit value

    Exit code 128 alone usually means a script called exit with a value outside the valid 0-255 range. Search the script for exit statements with large or negative numbers.

    grep -n 'exit ' ./script.sh
  3. Inspect the wrapper or process manager for signal forwarding

    Some process managers and CI runners translate signal kills into the 128+N convention. Check the wrapper logs for the signal that was forwarded.

    journalctl -u your-service --since '10 min ago' | tail -n 30

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.

Related Error Codes

Related Errors From Other Categories

Similar error codes documented across different platforms and systems