SIGBUS Signal Explained (Signal 7)

What the Linux SIGBUS signal does and when it's used.

Published October 24, 2026

SIGBUS (signal 7, bus error) is sent when a process makes an invalid memory access such as misaligned access or reading beyond a memory-mapped file that was truncated.

What it does

Default action: Terminate and dump core. It can be caught with a signal handler.

Typically sent by: the kernel on bad memory access. List all signals with kill -l.

Signal number and delivery

kill -l | grep SIGBUS
7) SIGBUS
kill -7 1234 # or kill -BUS 1234
(signal delivered to process 1234)

Practical examples

Send it from the shell

kill -7 <PID>
kill -SIGBUS <PID>
pkill -7 nginx

Handle it in a script

trap 'echo got SIGBUS; cleanup; exit' SIGBUS
while true; do sleep 1; done

Handle it in code

import signal, sys
def handler(sig, frame):
    print('received', sig)
    sys.exit(0)
signal.signal(signal.SIGBUS, handler)

Common mistakes

  • Using kill -9 before trying SIGTERM.
  • Forgetting to find the right PID (ps aux | grep, pgrep).
  • Not handling signals in long-running services.

Key takeaways

  • SIGBUS is signal 7.
  • Default: Terminate and dump core.
  • Use kill -l to list all signals.

FAQ

SIGBUS vs SIGSEGV?

SIGSEGV is an invalid address; SIGBUS is a valid address accessed incorrectly (alignment, mmap beyond file).

How do I list all signals?

Run kill -l.

More Linux articles