chown2 / lunaticvibesf

Lunatic Vibes F - a BMS client, a Lunatic Rave 2 clone
MIT License
4 stars 0 forks source link

Dead-lock when exiting any play scene customize with a chart loading #104

Closed chown2 closed 4 months ago

chown2 commented 4 months ago
Thread 108 (Thread 0x7fffee6006c0 (LWP 43344) "ChartBgaLoad"):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff7ade76a in std::__atomic_futex_unsigned_base::_M_futex_wait_until (this=<optimized out>, __addr=0x7fff9c1988e0, __val=2147483648, __has_timeout=<optimized out>, __s=..., __ns=...) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/futex.cc:122
#2  0x00005555557a2691 in SDL_Texture* pushAndWaitMainThreadTask<SDL_Texture*>(std::function<SDL_Texture* ()>) ()
#3  0x000055555579ff39 in Texture::Texture(int, int, Texture::PixelFormat, bool) ()
#4  0x00005555557affd8 in TextureVideo::TextureVideo(std::shared_ptr<sVideo>) ()
#5  0x00005555557b3723 in TextureBmsBga::addBmp(unsigned long, std::filesystem::__cxx11::path) ()
#6  0x00005555557e5c24 in ScenePlay::loadChart()::{lambda()#2}::operator()() const ()
#7  0x00005555557e5df7 in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<ScenePlay::loadChart()::{lambda()#2}> >, void> >::_M_invoke(std::_Any_data const&) ()
#8  0x00005555557a05b9 in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
#9  0x00007ffff78ae6af in __pthread_once_slow (once_control=0x7fff8c0789d8, init_routine=0x7ffff7ae0230 <std::__once_proxy()>) at pthread_once.c:116
#10 0x00005555557e1403 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<ScenePlay::loadChart()::{lambda()#2}> >, void>::_M_run() ()
#11 0x00007ffff7ae1943 in std::execute_native_thread_routine (__p=0x7fff8c078a10) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#12 0x00007ffff78a955a in start_thread (arg=<optimized out>) at pthread_create.c:447
#13 0x00007ffff7926a5c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 98 (Thread 0x7fffc60006c0 (LWP 43334) "UpdateLoop"):
#0  0x00007ffff78a5ebe in __futex_abstimed_wait_common64 (private=128, cancel=true, abstime=0x0, op=265, expected=43344, futex_word=0x7fffee600990) at futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x7fffee600990, expected=43344, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128, cancel=cancel@entry=true) at futex-internal.c:87
#2  0x00007ffff78a5f3f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffee600990, expected=<optimized out>, clockid=clockid@entry=0, ``abstime=abstime@entry=0x0, private=private@entry=128) at futex-internal.c:139
#3  0x00007ffff78ab0e3 in __pthread_clockjoin_ex (threadid=140737192658624, thread_return=0x0, clockid=0, abstime=0x0, block=<optimized out>) at pthread_join_common.c:102
#4  0x00007ffff7ae19b8 in __gthread_join (__value_ptr=0x0, __threadid=<optimized out>) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:669
#5  std::thread::join (this=0x7fff8c0789e0) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:134
#6  0x00005555557e0549 in std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<ScenePlay::loadChart()::{lambda()#2}> >, void>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#7  0x0000555555796977 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#8  0x00005555557f187b in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<std::_Bind<void (ScenePlay::*(ScenePlay*))()> > >, void> >::_M_invoke(std::_Any_data const&) ()
#9  0x00005555557a05b9 in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
#10 0x00007ffff78ae6af in __pthread_once_slow (once_control=0x7fff70faeb08, init_routine=0x7ffff7ae0230 <std::__once_proxy()>) at pthread_once.c:116
#11 0x00005555557f3fc3 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (ScenePlay::*(ScenePlay*))()> > >, void>::_M_run() ()
#12 0x00007ffff7ae1943 in std::execute_native_thread_routine (__p=0x7fff70f96ba0) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#13 0x00007ffff78a955a in start_thread (arg=<optimized out>) at pthread_create.c:447
#14 0x00007ffff7926a5c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 1 (Thread 0x7ffff7c8b780 (LWP 42636) "LunaticVibesF"):
#0  0x00007ffff78a5ebe in __futex_abstimed_wait_common64 (private=128, cancel=true, abstime=0x0, op=265, expected=43334, futex_word=0x7fffc6000990) at futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x7fffc6000990, expected=43334, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128, cancel=cancel@entry=true) at futex-internal.c:87
#2  0x00007ffff78a5f3f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffc6000990, expected=<optimized out>, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128) at futex-internal.c:139
#3  0x00007ffff78ab0e3 in __pthread_clockjoin_ex (threadid=140736515278528, thread_return=0x0, clockid=0, abstime=0x0, block=<optimized out>) at pthread_join_common.c:102
#4  0x00007ffff7ae19b8 in __gthread_join (__value_ptr=0x0, __threadid=<optimized out>) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:669
#5  std::thread::join (this=0x7fff70faeb10) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:134
#6  0x00005555557f36c9 in std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (ScenePlay::*(ScenePlay*))()> > >, void>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#7  0x0000555555796977 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#8  0x00005555557e53f3 in ScenePlay::~ScenePlay() ()
#9  0x0000555555796977 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#10 0x0000555555793974 in mainLoop() ()
#11 0x000055555576c5e1 in main ()
(gdb)
chown2 commented 4 months ago

Also when closing the game while the chart is loading:

(gdb) thread apply all bt
    ()
Thread 75 (Thread 0x7fffd28006c0 (LWP 49140) "ChartBgaLoad"):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff7ade76a in std::__atomic_futex_unsigned_base::_M_futex_wait_until (this=<optimized out>, __addr=0x7fff5a6d9000, __val=2147483648, __has_timeout=<optimized out>, __s=..., __ns=...) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/futex.cc:122
#2  0x00005555557a1d71 in void pushAndWaitMainThreadTask<void, SDL_Texture*>(std::function<void (SDL_Texture*)>, SDL_Texture*) ()
#3  0x00005555557a142d in std::_Sp_counted_deleter<SDL_Texture*, std::_Bind<void (*(void (*)(SDL_Texture*), std::_Placeholder<1>))(std::function<void (SDL_Texture*)>, SDL_Texture*)>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#4  0x00005555557a1559 in Texture::~Texture() ()
#5  0x0000555555796c97 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#6  0x00005555557b1bae in TextureBmsBga::clear() ()
#7  0x00005555557e5945 in ScenePlay::loadChart()::{lambda()#2}::operator()() const ()
#8  0x00005555557e5fc7 in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<ScenePlay::loadChart()::{lambda()#2}> >, void> >::_M_invoke(std::_Any_data const&) ()
#9  0x00005555557a08f9 in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
#10 0x00007ffff78ae6af in __pthread_once_slow (once_control=0x7fff90048728, init_routine=0x7ffff7ae0230 <std::__once_proxy()>) at pthread_once.c:116
#11 0x00005555557e15d3 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<ScenePlay::loadChart()::{lambda()#2}> >, void>::_M_run() ()
#12 0x00007ffff7ae1943 in std::execute_native_thread_routine (__p=0x7fff900f7620) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#13 0x00007ffff78a955a in start_thread (arg=<optimized out>) at pthread_create.c:447
#14 0x00007ffff7926a5c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 65 (Thread 0x7fffdb6006c0 (LWP 49130) "UpdateLoop"):
#0  0x00007ffff78a5ebe in __futex_abstimed_wait_common64 (private=128, cancel=true, abstime=0x0, op=265, expected=49140, futex_word=0x7fffd2800990) at futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x7fffd2800990, expected=49140, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128, cancel=cancel@entry=true) at futex-internal.c:87
#2  0x00007ffff78a5f3f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffd2800990, expected=<optimized out>, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128) at futex-internal.c:139
#3  0x00007ffff78ab0e3 in __pthread_clockjoin_ex (threadid=140736724993728, thread_return=0x0, clockid=0, abstime=0x0, block=<optimized out>) at pthread_join_common.c:102
#4  0x00007ffff7ae19b8 in __gthread_join (__value_ptr=0x0, __threadid=<optimized out>) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:669
#5  std::thread::join (this=0x7fff90048730) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:134
#6  0x00005555557e09d9 in std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<ScenePlay::loadChart()::{lambda()#2}> >, void>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#7  0x0000555555796c97 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#8  0x00005555557f1b4b in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<std::_Bind<void (ScenePlay::*(ScenePlay*))()> > >, void> >::_M_invoke(std::_Any_data const&) ()
#9  0x00005555557a08f9 in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
#10 0x00007ffff78ae6af in __pthread_once_slow (once_control=0x7fff70000cc8, init_routine=0x7ffff7ae0230 <std::__once_proxy()>) at pthread_once.c:116
#11 0x00005555557f4293 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (ScenePlay::*(ScenePlay*))()> > >, void>::_M_run() ()
#12 0x00007ffff7ae1943 in std::execute_native_thread_routine (__p=0x7fff70d4c580) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#13 0x00007ffff78a955a in start_thread (arg=<optimized out>) at pthread_create.c:447
#14 0x00007ffff7926a5c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 1 (Thread 0x7ffff7c86bc0 (LWP 48989) "LunaticVibesF"):
#0  0x00007ffff78a5ebe in __futex_abstimed_wait_common64 (private=128, cancel=true, abstime=0x0, op=265, expected=49130, futex_word=0x7fffdb600990) at futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x7fffdb600990, expected=49130, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128, cancel=cancel@entry=true) at futex-internal.c:87
#2  0x00007ffff78a5f3f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffdb600990, expected=<optimized out>, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=128) at futex-internal.c:139
#3  0x00007ffff78ab0e3 in __pthread_clockjoin_ex (threadid=140736873891520, thread_return=0x0, clockid=0, abstime=0x0, block=<optimized out>) at pthread_join_common.c:102
#4  0x00007ffff7ae19b8 in __gthread_join (__value_ptr=0x0, __threadid=<optimized out>) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:669
#5  std::thread::join (this=0x7fff70000cd0) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:134
#6  0x00005555557f3999 in std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (ScenePlay::*(ScenePlay*))()> > >, void>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#7  0x0000555555796c97 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#8  0x00005555557e55c3 in ScenePlay::~ScenePlay() ()
#9  0x0000555555796c97 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#10 0x0000555555793c94 in mainLoop() ()
#11 0x000055555576c7e1 in main ()