Start here · Essential guide
What Is a Segmentation Fault in C++?
A segmentation fault is a crash that occurs when a C++ program accesses memory it isn't allowed to use. Learn the causes and how to find the bug.
Strings, Containers and Memory
What causes a segmentation fault and what SIGSEGV means.
Start here · Essential guide
A segmentation fault is a crash that occurs when a C++ program accesses memory it isn't allowed to use. Learn the causes and how to find the bug.
Most segfaults come from a few coding mistakes, such as null pointers, out-of-bounds indexing and runaway recursion. Learn the usual suspects.
SIGSEGV is the signal Linux and other POSIX systems send when a program makes an invalid memory access. Learn how it works and how to catch it.
Memory segmentation divides a program's memory into regions such as code, data, heap and stack. See how each region works in C++, with a short example.
A segmentation fault is triggered when the CPU or OS rejects a memory access, such as an unmapped address or a write to read-only memory. Learn the checks.
Related topics