Calling SDL_Quit() in atterm() or atexit() cause segfault on MESA due to libgbm
Hi there,
I have been fixing my own builds of ECWolf for years now, but I think its time to report: using atexit() or atterm() to call SDL_Quit() causes segfault on light GNU/Linux systems with no X server which rely on KMSDRM using libgbm.
This is a known SDL2 issue with MESA: https://bugzilla.libsdl.org/show_bug.cgi?id=4530 https://lists.freedesktop.org/archives/mesa-users/2019-March/001519.html Look at MESA reply on this: https://lists.freedesktop.org/archives/mesa-users/2019-March/001520.html
Since using atterm() or atexit() to call MESA/libgbm deinit functiions inside SDL_Quit() is NOT a good idea at all, I recommend detecting if a subsystem has been init, and shut it down if it has.
Would you accept a PR fixing this (ie removing the use of atterm() for SDL2 shutdown)?
Comments (4)
-
-
Issue
#274was marked as a duplicate of this issue. -
- changed status to resolved
Addressed by 0e04ac0edbdef368f316721432e287417cd085b3
-
Issue
#266was marked as a duplicate of this issue. - Log in to comment
Duplicate of
#266which apparently was 7 months ago… Feel free to open your pull request and I’ll try to carve out some time this weekend to figure out how I want to go about this and if your solution matches what I would do.