Skip to content
The Signal Belfry

/static/campanario/en/sino/sigsegv/

Menu

SIG-010 · Program faults

SIGSEGV

The segmentation fault: the program touched memory that wasn't its own.

The name is a fossil of the segmented memory of the sixties — segmentation violation —, but the crime is still the same: reading or writing an address the page table does not authorize. The MMU objects, and the kernel turns the objection into this signal.

It is Unix's most famous crash. The core dump it leaves is the starting point of the investigation — gdb, coredumpctl — and runtimes like the JVM's and Go's catch it to turn it into a stack trace before it becomes an epitaph.

$ ./ponteiro-torto
Segmentation fault (core dumped)
$ coredumpctl gdb ./ponteiro-torto
#0  0x0000561f2a3c114d in main () at torto.c:7
7         *p = 42;
Line 7 wrote where it shouldn't; the core tells the story.