-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
__attribute__((destructor)) is a bad place for cleanup, so xr_3da fails assert on termination #804
Comments
This is mainly Linux-related. And in theory, not only on Elbrus. |
… __attribute__((constructor)) / __attribute__((destructor)) (#804)
I confirm, the game doesn't crash anymore 👍 |
@kosumosu doesn't crash even with removed FACTORY_PTR_INSTANCIATE workaround? |
I'm trying this right now... |
@Xottab-DUTY Without it I got SIGSEGV when tried to "exit to windows" from menu right away.
|
That have been a long time. I'm not sure I still have access to e2k and have proper setup... |
@kosumosu, this should be reproducible on any Linux machine I think. |
I faced several failed assertions in mimalloc when I was trying to close the game.
I started investigating this and found out that the problem was not in the allocator itself, but in the fact that the allocator was destroyed BEFORE the failed assertion. Further investigation has shown that even though
SDL_UnloadObject()
is called before returning frommain()
, the__attribute__((destructor)) unload()
is called AFTER return frommain()
. So global variables insidexrGame.so
turn into a garbage by the time the control reachesunload()
.This causes xray to crash every time it terminates on e2k. It also leads to hanging fullscreen, causing big trouble to a user.
So resources from shared libraries must be cleaned up explicitly instead.
The text was updated successfully, but these errors were encountered: