$ gdb ./a.out (gdb) run <segfault happens here> (gdb) backtrace <offending code is shown here>