[SDL] [SDL2] SDL_Init freezing with SDL_INIT_TIMER

Erick Sousa puyolzits at gmail.com
Wed Mar 6 06:04:32 PST 2013


Greetings SDL community!

I started porting my game engine from SDL to SDL2 yesterday and I ran into
a strange issue.
When calling SDL_Init with SDL_INIT_TIMER flag, the function never returns.
It just stays there in some kind of infinite loop.
The same behavior happens when i'm trying to initialize SDL2_mixer,
although SDL2_image and SDL2_ttf are correctly
initialized and work ok.

My code basically calls SDL_Init with SDL_INIT_TIMER, SDL_INIT_VIDEO and
SDL_INIT_AUDIO flags. And then it initializes
SDL2_ttf, SDL2_image and SDL2_mixer. When calling SDL_Init without
SDL_INIT_TIMER and with SDL2_mixer commented,
there's no freezing.

I'm using Ubuntu 12.04 LTS on a x64 machine. I've compiled SDL2 directly
from hg as well as SDL2_image, SDL2_ttf and
SDL2_mixer.

I don't know if it's ok to just paste the trace, but here it is:

#0  __lll_lock_wait () at
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:132
#1  0x00007ffff70c7065 in _L_lock_858 () from
/lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007ffff70c6eba in __pthread_mutex_lock (mutex=0x6054b0) at
pthread_mutex_lock.c:61
#3  0x00007ffff6e88c4c in SDL_mutexP (mutex=0x6054b0) at
/home/puyol/prog/SDL2/src/thread/pthread/SDL_sysmutex.c:103
#4  0x00007ffff6e89011 in SDL_DestroySemaphore (sem=0x605490) at
/home/puyol/prog/SDL2/src/thread/generic/SDL_syssem.c:126
#5  0x00007ffff6e2b5dd in SDL_CreateThread (fn=<optimized out>,
name=<optimized out>, data=<optimized out>)
    at /home/puyol/prog/SDL2/src/thread/SDL_thread.c:286
#6  0x00007ffff6e2bb30 in SDL_TimerInit () at
/home/puyol/prog/SDL2/src/timer/SDL_timer.c:230
#7  0x00007ffff6ddfc75 in SDL_InitSubSystem (flags=49) at
/home/puyol/prog/SDL2/src/SDL.c:106
#8  0x00007ffff6ddfd3a in SDL_Init (flags=49) at
/home/puyol/prog/SDL2/src/SDL.c:216
#9  0x00007ffff7bc7899 in Polymorphic::Engine::Initialize () at
src/engine.cpp:78
#10 0x00007ffff7bc8093 in Polymorphic::Engine::Run (gi=0x7fffffffe100) at
src/engine.cpp:134
#11 0x00000000004014d7 in main (argc=1, argv=0x7fffffffe218) at
src/main.cpp:10

If there's any information I forgot to provide, just tell me. Any help will
be appreciated.

Thanks for you time,

Erick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130306/44041055/attachment-0008.htm>


More information about the SDL mailing list