Hello,
I'm a beginner programmer writing a game using C::B 13.12 and am having a problem I can't figure out. Under normal circumstances when I compile and run my game, everything is fine. However when I try to profile the application by enabling 'Profile code when executed [-pg]' and rebuilding, then things still compile and run OK, but when I actually exit the application, it segfaults. If I set a breakpoint and step through the code line-by-line, it crashes after the return statement at the end of main().
If I uncheck the profile code option and rebuild, things are fine again and the program closes without complaint - the crash-on-exit only happens if I'm trying to profile.
Here is the call stack and debugger output:
Program received signal SIGSEGV, Segmentation fault.
In open () ()
143 ../src/main/windows/SDL_windows_main.c: No such file or directory.
#4 0x004262d4 in console_main (argc=1, argc@entry=0, argv=0x390008, argv@entry=0xf63518) at ../src/main/windows/SDL_windows_main.c:143
I set up a second very simple hello-world type application to test things out, and the profiler works fine on that (I am able to exit the hello-world application without issue and then view the gprof output using the plugin). So the problem is clearly with my code, but I don't know what it is or where I should start looking.
I realise that I've given little information to go on, but I don't know what aspects of my code might be relevant. If anyone could at least point me in the vague direction of what I should be investigating that would be a great help.