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.