I'm running my program under gdb, with debuging information and without any optimizations. gdb reports:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffeffff700 (LWP 8875)]
0x0000001000000001 in ?? ()
From this message i do not understand where the problem happened. Is it possible to extract stacktrace / problem file and line number?
To get the point where code segmentation fault has happened, you should use backtrace (bt) command.
There are wide range of commands available inside gdb which should be explored to help make you debug your code as efficiently as possible.
e.g. you could record your code flow and replay it in reverse. explore data types have breakpoints etc.