dos1 / SuperDerpy

Become Derpy Hooves and fight with muffinzombies in this free software game in order to rescue Ponyville ponies so they can defeat Discord once again! Written in C using Allegro 5, works on Windows, GNU/Linux and Mac OS X.
http://www.superderpy.com/
GNU General Public License v2.0
18 stars 4 forks source link

Occasional pre-menu freeze #32

Closed jigpu closed 12 years ago

jigpu commented 12 years ago

Sometimes after starting the program, it will freeze before the main menu's "loading" screen. Specifically, it hangs while executing one of these two lines in main.c:

al_register_event_source(game.event_queue, al_get_timer_event_source(game.timer));
al_wait_for_vsync();

It appears to be some kind of race condition, as the addition of printf statements throughout the code changes how often it's triggered. For example, the program never freezes with a printf placed between the two quoted lines (hence my problems isolating it to one line or the other).

dos1 commented 12 years ago

What platform? Never seen that here on Linux, and nobody else reported that on Windows. Looks like some Allegro bug...

jigpu commented 12 years ago

Arch Linux x86_64 with the 'nvidia' driver. I can report the exact version numbers when I'm back home again.

jigpu commented 12 years ago

Some additional background info: I just updated my system and and continue to see the problem. Possibly relevant software versions are: Xorg server 1.12 (extra/xorg-server 1.12.3-1), nVidia binary drivers 302.17 (extra/nvidia 302.17-2 and extra/nvidia-utils 302.17-1), and Allegro 5.0.7 (community/allegro 5.0.7-1). Hardware is 2x GTX 560 Ti cards, though only one is actually in use by X at the moment.

I concur that its probably either an Allegro or nVidia bug. Between the following backtrace obtained while the program is frozen and the fact that it appears to work without issues when using my integrated Intel graphics, I don't see much room for SuperDerpy itself to be at fault.

(gdb) bt
#0  0x00007ffff66ebebd in poll () from /lib/libc.so.6
#1  0x00007ffff582de8d in ?? () from /lib/libGL.so.1
#2  0x00007ffff2853f70 in ?? () from /lib/libnvidia-glcore.so.302.17
#3  0x00007ffff57f87c4 in glXWaitVideoSyncSGI () from /lib/libGL.so.1
#4  0x00007ffff7b8baa0 in ?? () from /lib/liballegro.so.5.0
#5  0x00000000004057ae in main (argc=1, argv=0x7fffffffe678) at src/main.c:424

Feel free to close this issue if you feel it appropriate.

dos1 commented 12 years ago

Hmm... Maybe try to disable vsync. There's a config option for that in SuperDerpy.ini, but on some configurations you may also need to tweak settings of your video driver.

Building Allegro with debug symbols and sending backtrace to Allegro developers might be a good idea too.