Skip to content
The Signal Belfry

/static/campanario/en/sino/sigbus/

Menu

SIG-011 · Program faults

SIGBUS

Bus error: the address does exist — it's the access that cannot happen.

SIGSEGV's rare cousin, with a fine distinction: in SEGV the address is not mapped; in BUS the mapping exists, but the physical access is invalid. The name comes from machines whose memory bus refused misaligned accesses — something x86 tolerates and other architectures do not.

On today's Linux, the most common way to hear it is via mmap: map a file and touch a page past its end — because another process truncated it under your feet. Databases that map files treat this bell with respect.

$ ./leitor-mmap dados.bin &
$ truncate -s 0 dados.bin
Bus error (core dumped)
(the mapped page lost the file that backed it)
The file shrank; the mapping was left hanging.