libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
193 stars 40 forks source link

bumprace: not all graphics loaded, hangs for a while when you collide with an obstacle #253

Closed smcv closed 1 year ago

smcv commented 1 year ago

Prerequisites:

To reproduce:

Watch for a copyright message before the main menu appears.

Use arrow keys and Enter to select "1 player game", "Flying saucer (Best steering)".

Use Left/Right arrow keys to rotate (the red tick mark on the flying saucer is the back end) and Up arrow key to fire the engine. Steer yourself into an enemy (grey shuriken-looking things) or obstacle (electricity). If necessary exit the level (press Esc repeatedly) and start again to get a level where there is electricity closer to your starting position.

Expected result: The copyright message is visible. After colliding, an explosion and "CRASHED" appear, and the level restarts.

Actual result: with real SDL 1.2, as expected. With sdl12-compat, the copyright message is not shown (the relevant part of the screen remains blank), and during gameplay, the explosion and "CRASHED" do not appear and the game freezes for a while (music continues to play but the game is unresponsive). Sometimes it resumes gameplay after waiting a while, but usually it does not.

smcv commented 1 year ago
Stack trace after sending SIGQUIT while it is in the hanging state ``` (gdb) thread apply all bt Thread 12 (Thread 0x7fabf2ffd640 (LWP 15370)): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555693137c) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55555693137c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555693137c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139 #3 0x00007fac22686c00 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556931328, cond=0x555556931350) at ./nptl/pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x555556931350, mutex=0x555556931328) at ./nptl/pthread_cond_wait.c:618 #5 0x00007fac11107719 in cnd_wait (cond=, mtx=) at ../src/c11/impl/threads_posix.c:135 #6 0x00007fac110bc7cb in util_queue_thread_func (input=input@entry=0x5555571a75c0) at ../src/util/u_queue.c:287 #7 0x00007fac11107657 in impl_thrd_routine (p=) at ../src/c11/impl/threads_posix.c:67 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 11 (Thread 0x7fabf27fc640 (LWP 15371)): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555693137c) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55555693137c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555693137c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139 #3 0x00007fac22686c00 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556931328, cond=0x555556931350) at ./nptl/pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x555556931350, mutex=0x555556931328) at ./nptl/pthread_cond_wait.c:618 #5 0x00007fac11107719 in cnd_wait (cond=, mtx=) at ../src/c11/impl/threads_posix.c:135 #6 0x00007fac110bc7cb in util_queue_thread_func (input=input@entry=0x5555571a1a30) at ../src/util/u_queue.c:287 #7 0x00007fac11107657 in impl_thrd_routine (p=) at ../src/c11/impl/threads_posix.c:67 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 10 (Thread 0x7fac00ffd640 (LWP 15362)): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x5555569318e8) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x5555569318e8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x5555569318e8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139 #3 0x00007fac22686c00 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556931898, cond=0x5555569318c0) at ./nptl/pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x5555569318c0, mutex=0x555556931898) at ./nptl/pthread_cond_wait.c:618 #5 0x00007fac11107719 in cnd_wait (cond=, mtx=) at ../src/c11/impl/threads_posix.c:135 #6 0x00007fac110bc7cb in util_queue_thread_func (input=input@entry=0x55555699fd00) at ../src/util/u_queue.c:287 #7 0x00007fac11107657 in impl_thrd_routine (p=) at ../src/c11/impl/threads_posix.c:67 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 9 (Thread 0x7fabf3fff640 (LWP 15368)): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fac10013550) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x7fac10013550, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fac10013550, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139 #3 0x00007fac22686c00 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7fac10013500, cond=0x7fac10013528) at ./nptl/pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x7fac10013528, mutex=0x7fac10013500) at ./nptl/pthread_cond_wait.c:618 #5 0x00007fac11107719 in cnd_wait (cond=, mtx=) at ../src/c11/impl/threads_posix.c:135 #6 0x00007fac110bc7cb in util_queue_thread_func (input=input@entry=0x555556a4c9f0) at ../src/util/u_queue.c:287 #7 0x00007fac11107657 in impl_thrd_routine (p=) at ../src/c11/impl/threads_posix.c:67 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 8 (Thread 0x7fac10c55640 (LWP 15359)): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555692218c) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55555692218c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555692218c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139 #3 0x00007fac22686c00 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556922138, cond=0x555556922160) at ./nptl/pthre--Type for more, q to quit, c to continue without paging--c ad_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x555556922160, mutex=0x555556922138) at ./nptl/pthread_cond_wait.c:618 #5 0x00007fac11107719 in cnd_wait (cond=, mtx=) at ../src/c11/impl/threads_posix.c:135 #6 0x00007fac110bc7cb in util_queue_thread_func (input=input@entry=0x555556921150) at ../src/util/u_queue.c:287 #7 0x00007fac11107657 in impl_thrd_routine (p=) at ../src/c11/impl/threads_posix.c:67 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 7 (Thread 0x7fac017fe640 (LWP 15361)): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x555556931378) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x555556931378, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x555556931378, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139 #3 0x00007fac22686c00 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556931328, cond=0x555556931350) at ./nptl/pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x555556931350, mutex=0x555556931328) at ./nptl/pthread_cond_wait.c:618 #5 0x00007fac11107719 in cnd_wait (cond=, mtx=) at ../src/c11/impl/threads_posix.c:135 #6 0x00007fac110bc7cb in util_queue_thread_func (input=input@entry=0x55555699fa30) at ../src/util/u_queue.c:287 #7 0x00007fac11107657 in impl_thrd_routine (p=) at ../src/c11/impl/threads_posix.c:67 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 6 (Thread 0x7fabf37fe640 (LWP 15369)): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x555556931378) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x555556931378, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x555556931378, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139 #3 0x00007fac22686c00 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556931328, cond=0x555556931350) at ./nptl/pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x555556931350, mutex=0x555556931328) at ./nptl/pthread_cond_wait.c:618 #5 0x00007fac11107719 in cnd_wait (cond=, mtx=) at ../src/c11/impl/threads_posix.c:135 #6 0x00007fac110bc7cb in util_queue_thread_func (input=input@entry=0x55555719eb30) at ../src/util/u_queue.c:287 #7 0x00007fac11107657 in impl_thrd_routine (p=) at ../src/c11/impl/threads_posix.c:67 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 5 (Thread 0x7fac20915640 (LWP 15354)): #0 0x00007fac226fe426 in __ppoll (fds=0x555556834290, nfds=2, timeout=, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:42 #1 0x00007fac2205c029 in ppoll (__ss=0x0, __timeout=, __nfds=, __fds=) at /usr/include/x86_64-linux-gnu/bits/poll2.h:64 #2 pa_mainloop_poll (m=m@entry=0x55555682a990) at ../src/pulse/mainloop.c:871 #3 0x00007fac2205c606 in pa_mainloop_iterate (m=m@entry=0x55555682a990, block=block@entry=1, retval=retval@entry=0x0) at ../src/pulse/mainloop.c:945 #4 0x00007fac2205c6b0 in pa_mainloop_run (m=0x55555682a990, retval=0x0) at ../src/pulse/mainloop.c:963 #5 0x00007fac21d3b7ef in HotplugThread (data=data@entry=0x0) at ./src/audio/pulseaudio/SDL_pulseaudio.c:841 #6 0x00007fac21cd7e65 in SDL_RunThread (thread=0x55555683d220) at ./src/thread/SDL_thread.c:303 #7 0x00007fac21d6fc49 in RunThread (data=) at ./src/thread/pthread/SDL_systhread.c:77 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 4 (Thread 0x7fac137fe640 (LWP 15356)): #0 __futex_abstimed_wait_common64 (private=, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555683c520) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55555683c520, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555683c520, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=) at ./nptl/futex-internal.c:139 #3 0x00007fac2268f5cf in do_futex_wait (sem=sem@entry=0x55555683c520, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:111 #4 0x00007fac2268f668 in __new_sem_wait_slow64 (sem=sem@entry=0x55555683c520, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:183 #5 0x00007fac2268f6e1 in __new_sem_wait (sem=sem@entry=0x55555683c520) at ./nptl/sem_wait.c:42 #6 0x00007fac21d700c2 in SDL_SemWait_REAL (sem=0x55555683c520) at ./src/thread/pthread/SDL_syssem.c:95 #7 0x00007fac21cd8387 in SDL_TimerThread (_data=_data@entry=0x7fac21dfbd40 ) at ./src/timer/SDL_timer.c:203 #8 0x00007fac21cd7e65 in SDL_RunThread (thread=0x555556862770) at ./src/thread/SDL_thread.c:303 #9 0x00007fac21d6fc49 in RunThread (data=) at ./src/thread/pthread/SDL_systhread.c:77 #10 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #11 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 3 (Thread 0x7fac01fff640 (LWP 15360)): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555699e838) at ./nptl/futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55555699e838, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at ./nptl/futex-internal.c:87 #2 0x00007fac226844bb in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555699e838, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139 #3 0x00007fac22686c00 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55555699e7e8, cond=0x55555699e810) at ./nptl/pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x55555699e810, mutex=0x55555699e7e8) at ./nptl/pthread_cond_wait.c:618 #5 0x00007fac11107719 in cnd_wait (cond=, mtx=) at ../src/c11/impl/threads_posix.c:135 #6 0x00007fac110bc7cb in util_queue_thread_func (input=input@entry=0x55555699f750) at ../src/util/u_queue.c:287 #7 0x00007fac11107657 in impl_thrd_routine (p=) at ../src/c11/impl/threads_posix.c:67 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 2 (Thread 0x7fac13fff640 (LWP 15355)): #0 0x00007fac226fe426 in __ppoll (fds=0x55555683d8d0, nfds=2, timeout=, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:42 #1 0x00007fac2205c029 in ppoll (__ss=0x0, __timeout=, __nfds=, __fds=) at /usr/include/x86_64-linux-gnu/bits/poll2.h:64 #2 pa_mainloop_poll (m=m@entry=0x55555683ae80) at ../src/pulse/mainloop.c:871 #3 0x00007fac2205c606 in pa_mainloop_iterate (m=0x55555683ae80, block=, retval=0x0) at ../src/pulse/mainloop.c:945 #4 0x00007fac21d3b422 in PULSEAUDIO_PlayDevice (this=0x55555683add0) at ./src/audio/pulseaudio/SDL_pulseaudio.c:399 #5 0x00007fac21c6df5d in SDL_RunAudio (devicep=devicep@entry=0x55555683add0) at ./src/audio/SDL_audio.c:781 #6 0x00007fac21cd7e65 in SDL_RunThread (thread=0x55555684b180) at ./src/thread/SDL_thread.c:303 #7 0x00007fac21d6fc49 in RunThread (data=) at ./src/thread/pthread/SDL_systhread.c:77 #8 0x00007fac2268784a in start_thread (arg=) at ./nptl/pthread_create.c:442 #9 0x00007fac2270b2cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 1 (Thread 0x7fac2091b280 (LWP 15353)): #0 0x00007fac226d1445 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7ffc2c5172f0, rem=rem@entry=0x7ffc2c5172e0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48 #1 0x00007fac226d5ec3 in __GI___nanosleep (req=req@entry=0x7ffc2c5172f0, rem=rem@entry=0x7ffc2c5172e0) at ../sysdeps/unix/sysv/linux/nanosleep.c:25 #2 0x00007fac21d77071 in SDL_Delay_REAL (ms=) at ./src/timer/unix/SDL_systimer.c:219 #3 0x00007fac22a8ed4a in () #4 0x00007fac22af1de0 in () #5 0x00007fac22a9113f in () #6 0x00005555573779a0 in () #7 0x3f80000022aa18d0 in () #8 0x00007fac22a988c0 in () #9 0x00007fac22aa1b60 in () #10 0x00007fac22aa18d0 in () #11 0x00007fac22a914e5 in () #12 0x00007fac22aa1860 in () #13 0x00007fac22a8e8a7 in () #14 0x0000000000000000 in () ```
smcv commented 1 year ago

With https://github.com/libsdl-org/sdl12-compat/commit/67f8b3a85b782eefb4db90f34d5b0742ef2cb5fc (1.2.58 + 29 commits) the copyright message, explosion and CRASHED appear as expected, but on Wayland the game sometimes (50%) becomes unresponsive anyway. With X11 it seems to be reliable?

icculus commented 1 year ago

We'll track that separately, since that's going to get revisited after the 1.2.60 release.