[SDL] SDL_Init issue
Kostas Kostiadis
kos at climaxgroup.com
Wed May 2 10:22:30 PDT 2007
Can't really help if you've somehow clobbered the stack...You'll have to
play around with the debugger and figure it out yourself.
However, there IS help in determining whether you've called SDL_Init() more
than once from different threads.
Have a look at SDL_WasInit.
http://docs.mandragor.org/files/Common_libs_documentation/SDL/SDL_Documentat
ion_project_en/sdlwasinit.html
<http://docs.mandragor.org/files/Common_libs_documentation/SDL/SDL_Documenta
tion_project_en/sdlwasinit.html>
It allows you to see which SDL subsystems have been initialised.
Good luck.
Cheers,
Kos
_____
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of chris.2.dobbs at bt.com
Sent: 02 May 2007 18:13
To: sdl at lists.libsdl.org
Subject: [SDL] SDL_Init issue
All,
I have some code which uses SDL for both audio/timers and threads. The
program spawns several worker threads (using SDL threads) and the main line
code calls the SDL_Init() function once only.
When I run the program normally everything is fine BUT when I run it thru a
debugger (like gdb or NJAMD) I get a segment fault after the call the
SDL_Init().
gdb simply dies stone dead at this point with an invalid traceback address
which is useless so I ran NJAMD wrapper and it shits itself at the same
point however I get a little more info:
NJAMD/free: Address 0x0 not from malloc
called from ./transcoder_client[0x8058baf]
called from ./transcoder_client[0x804c4e6]
The first address above translates to the source code point where I call
SDL_Init(SDL_INIT_AUDIO|SDL_INIT_TIMER)
It is very likely that I have clobbered the stack earlier on as this is new
code and untested , or the debugger is getting confused with the multiple
threads ; I just wanted to check, before I dive in and hunt for code
problems, if there are an caveats concerning SDL_Init() and multi-threaded
models?
Are there any problems in calling SDL_init() more than once from different
threads in the same process context as I 'may' have this going on too....
:-)
Regards,
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070502/221f78f1/attachment.html
More information about the SDL
mailing list