Segmentation Fault in SDL_Quit();

~Game (this=0xbffff9f0) at game.cpp:35
35 SDL_Quit();
(gdb)
36 if (mp_s_scr != NULL)
(gdb)
37 SDL_FreeSurface(mp_s_scr);
(gdb)

Program received signal SIGSEGV, Segmentation fault.
0x40222049 in free () from /lib/libc.so.6
(gdb)

Hi, I don’t understand why when I call SDL_Quit(), my game exit with an
segmentation fault.

You are probably accessing memory “out of bounds” in your application,
typically writing a byte to much to your screen buffer.

/D

-----Opprinnelig melding-----Fra: sdl-bounces+ds=poseidon.no at libsdl.org
[mailto:sdl-bounces+ds=poseidon.no at libsdl.org]P? vegne av NighTiger
Sendt: 21. mai 2004 14:38
Til: SDL
Emne: [SDL] Segmentation Fault in SDL_Quit();

~Game (this=0xbffff9f0) at game.cpp:35
35 SDL_Quit();
(gdb)
36 if (mp_s_scr != NULL)
(gdb)
37 SDL_FreeSurface(mp_s_scr);
(gdb)

Program received signal SIGSEGV, Segmentation fault.
0x40222049 in free () from /lib/libc.so.6
(gdb)

Hi, I don’t understand why when I call SDL_Quit(), my game exit with an
segmentation fault.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I’d suggest you use something like Valgrind (http://valgrind.kde.org) to debug
memory usage in your program. Also, if you are using threads, you may find
the problem you are having might be due to a race condition, which Valgrind
will not pick up. In this case you have to debug it manually (using gdb and
printf statements). I had this problem in my application, where a thread
started before quitting was only starting to run at the point SDL_Quit() was
being called.

Cheers,
PaulOn Sat, 22 May 2004 00:37, NighTiger wrote:

Hi, I don’t understand why when I call SDL_Quit(), my game exit with an
segmentation fault.