libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10k stars 1.85k forks source link

SDL3 - segfault when reinitializing SDL #9360

Closed slembcke closed 1 month ago

slembcke commented 7 months ago

In order to switch between Vk and GL in my game, I fully reinitialize SDL. This worked in SDL2, and IIRC it avoided some issues.

This doesn't work in SDL3 however. I get a segfault in SDL_VideoInit() the second time around. (Fedora tested with both X11 and Wayland) In the past @icculus said "this is allowed behavior, afaik." Is that still true? If this is considered undefined behavior now in v3 I can try rewriting it to just recreate the window instead.

icculus commented 7 months ago

This sounds like an SDL bug from here.

icculus commented 7 months ago

If you can say where it crashes, or have a tiny reproduction case we can run, please post it, though!

slembcke commented 7 months ago

Hmm. Tried to make a minimal example, but that works just fine. I won't have time this weekend to look into it more, but I should have time in a few days.

slouken commented 1 month ago

It looks like you haven't had time to get back to this, let us know if you're still seeing the issue?