-
Notifications
You must be signed in to change notification settings - Fork 73
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
librvvm: Dynamic unloading doesn't deinit #97
Comments
Implemented @iyzsong can you please verify it doesn't segfault anymore? |
well, it still segfault. |
Ah sorry, makes sense. My local threadpool implementation is different, so I should upstream it soon and that's gonna be it |
Should be fixed now, the threadpool is properly joined on deinit. |
Well, first "Close Content" does deinit correctly, but then load a rvvm file and close again will segfault, i think that's a RetroArch issue.. |
I wrote a simple program that explicitly loads UPD: introduced a deinit hook that reaps every running machine and prints a warn. I don't know any other way that could cause a segv for now. UPD: need to rewrite eventloop a bit to be |
Implemented proper eventloop termination in 7ef1adc. There are no places where Is it working OK now? |
Yes, it's working, before and after commit 7ef1adc. My previous issue was due to the second load by "History" will load a different rvvm_libretro.so than the latest built one... Its shutdown sequence rvvm_run_eventloop -> rvvm_free_machine -> full_deinit (auto called by DEINIT_ATTR) was correct (with a seperated |
That commit fixes a race condition where the eventloop might run for a few spare moments after all machines have been shut down. I.e. without that commit there might be still a rare segv occurence, but now all is fixed. Thanks for the PR! |
The issue
librvvm
, unloading it leaves some global state initializedSteps to reproduce
libretro
port of RVVM (See Add libretro core #96), I.e. load the libInvestigation
atexit()
, which is fine for standalone VM but not for a libWorkarounds
Suggested fix
rvvm_at_deinit()
callbacks instead ofatexit()
rvvm_deinit()
API that is called before unloading the libThe text was updated successfully, but these errors were encountered: