Author Topic: Crash on exit when trying to profile  (Read 2221 times)

lyrebird

  • Guest
Crash on exit when trying to profile
« on: January 12, 2015, 08:00:47 am »
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:



Code
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Crash on exit when trying to profile
« Reply #1 on: January 12, 2015, 09:07:40 am »
Can't do much to help you.
This is a problem that your compiler vendor should answer or help you with.
We're just an IDE project, and we support many compilers and different versions of them.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]