Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to shutdown gracefully on devices that don't have required vulkan extensions #2

Open
fzurita opened this issue Dec 27, 2021 · 1 comment

Comments

@fzurita
Copy link

fzurita commented Dec 27, 2021

There seems to be a potential race condition during shutdown on devices that don't support all the correct vulkan extensions, like some Android devices.

Mainly I'm getting this stack trace sometimes:

Crashed: Thread: SIGABRT  0x0000000000000000
#00 pc 0x2216c libc.so 
#01 pc 0x22140 libc.so 
#02 pc 0x919e8 libc.so 
#03 pc 0x91050 libc.so 
#04 pc 0x90ecc libc.so 
#05 pc 0x4546d4 libmupen64plus-video-parallel.so (<name omitted> [__threading_support:367])
#06 pc 0x4069b4 libmupen64plus-video-parallel.so (RDP::Renderer::maintain_queues_idle() [__mutex_base:91])
#07 pc 0x3fdabc libmupen64plus-video-parallel.so (RDP::CommandProcessor::enqueue_command_direct(unsigned int, unsigned int const*) [rdp_device.cpp:939])
#08 pc 0x3fa5dc libmupen64plus-video-parallel.so (RDP::CommandRing::thread_loop() [command_ring.cpp:126])
#09 pc 0x3fad84 libmupen64plus-video-parallel.so (void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct> >, void (RDP::CommandRing::*)(), RDP::CommandRing*> >(void*) [thread:273])
#10 pc 0x90328 libc.so 
#11 pc 0x23a28 libc.so 

I would take the line numbers with a grain of salt since these are stack traces coming out of optimized builds. Some of the stack is also missing due to the build being optimized. Anyways, an invalid mutex seems to be getting locked during shutdown. It almost seems like the thread is still running after the Renderer object is destroyed.

@fzurita
Copy link
Author

fzurita commented Dec 27, 2021

It would also be useful to have the RomOpen thread:

#00 pc 0x86b4c libc.so 
#01 pc 0xebe4c libc.so 
#02 pc 0x45e7cc libmupen64plus-video-parallel.so (std::__ndk1::thread::join() [__threading_support:486])
#03 pc 0x3fa890 libmupen64plus-video-parallel.so (RDP::CommandRing::~CommandRing() [command_ring.cpp:60])
#04 pc 0x3fc52c libmupen64plus-video-parallel.so (RDP::CommandProcessor::~CommandProcessor() [rdp_device.cpp:167])
#05 pc 0x453a54 libmupen64plus-video-parallel.so (std::__ndk1::default_delete<RDP::CommandProcessor>::operator()(RDP::CommandProcessor*) const [memory:2427])
#06 pc 0x45395c libmupen64plus-video-parallel.so (vk_init [parallel_imp.cpp:273])
#07 pc 0x452860 libmupen64plus-video-parallel.so (RomOpen [gfx_m64p.c:245])
#08 pc 0x25880 boot-core-libart.oat 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant