132
BashCRITICALSignalHIGH confidence

Illegal instruction (SIGILL)

Production Risk

Common when deploying binaries compiled on modern hardware to older servers; always test on target hardware.

What this means

Exit code 132 (128+4) indicates the process attempted to execute an illegal or privileged CPU instruction and was terminated by SIGILL.

Why it happens
  1. 1Binary compiled for a newer CPU instruction set than the current CPU (e.g., AVX-512 binary on a non-AVX-512 CPU)
  2. 2Compiler bug or stack corruption that caused the instruction pointer to jump to a non-code region
  3. 3Attempting to execute a privileged instruction in user mode
How to reproduce

Running a binary built with AVX-512 on a CPU that does not support it.

trigger — this will error
trigger — this will error
# Binary compiled with -march=native on a newer CPU
# Run on older CPU:
./avx512-optimized-binary
echo "Exit: $?"

expected output

Illegal instruction (core dumped)
Exit: 132

Fix 1

Recompile without CPU-specific optimizations

WHEN The binary was built for a different CPU microarchitecture

Recompile without CPU-specific optimizations
# Instead of -march=native (targets build CPU):
gcc -O2 -o myprogram myprogram.c
# Or target a baseline:
gcc -O2 -march=x86-64 -o myprogram myprogram.c

Why this works

-march=x86-64 targets the baseline x86-64 instruction set, which all 64-bit x86 CPUs support.

Fix 2

Check CPU flags to diagnose mismatch

WHEN Diagnosing SIGILL on deployment

Check CPU flags to diagnose mismatch
# Check CPU features on the target machine
grep flags /proc/cpuinfo | head -1
# Common missing flags: avx, avx2, avx512f

Why this works

/proc/cpuinfo flags lists all CPU instruction set extensions supported by the current CPU.

Sources
Official documentation ↗

GNU Bash Manual — Signals

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Bash errors