Just use a debugger and it will tell you the exact location where the exception is thrown.
If you have gdb installed you just run your program with gdb ./yourprogram, then run, and then when it crashes you just type bt and it will print a full stack trace (assuming you have compiled with debugging symbols turned on, i.e. used the -g compiler flag).
@keskiverto That might be what's causing it. On my virtual machine I set the resolution to 640x400 to reduce lag, so the terminal definetely didnt have 64 columns... I will check it now.