What causes a SIGSEGV

Wikipedia has the answer, along with a number of other sources. A segfault basically means you did something bad with pointers. This is probably a segfault: Or this: Or maybe this: Same basic principle in each case – you’re doing something with memory that isn’t yours.

What is a segmentation fault?

Segmentation fault is a specific kind of error caused by accessing memory that “does not belong to you.” It’s a helper mechanism that keeps you from corrupting the memory and introducing hard-to-debug memory bugs. Whenever you get a segfault you know you are doing something wrong with memory – accessing a variable that has already … Read more