-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Crash when closing secondary window with Vulkan renderer on Linux w/ Wayland #12053
Comments
Can you git bisect where this starts? SDL2 did not have a Vulkan renderer, so it would make sense that it didn't happen there. |
I don't think this is an SDL bug. You destroy Does it still crash if you set |
Even with a minimal reproducible example that avoids that (and works on older versions of SDL3), the problem still occurs. #include <stdlib.h>
#include <SDL3/SDL.h>
static SDL_Window *window1;
static SDL_Renderer *renderer1;
static SDL_Window *window2;
static SDL_Renderer *renderer2;
int main(int argc, char **argv)
{
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_EVENTS | SDL_INIT_GAMEPAD);
SDL_CreateWindowAndRenderer("window 1", 300, 300, SDL_WINDOW_HIGH_PIXEL_DENSITY | SDL_WINDOW_RESIZABLE, &window1, &renderer1);
SDL_CreateWindowAndRenderer("window 2", 200, 200, SDL_WINDOW_HIGH_PIXEL_DENSITY | SDL_WINDOW_RESIZABLE, &window2, &renderer2);
int quit = 0;
while (!quit)
{
SDL_Event event;
if (SDL_WaitEvent(&event))
{
switch (event.type)
{
case SDL_EVENT_WINDOW_CLOSE_REQUESTED:
case SDL_EVENT_QUIT:
if (window2 != NULL)
{
SDL_DestroyRenderer(renderer2);
SDL_DestroyWindow(window2);
window2 = NULL;
}
else
{
quit = 1;
}
break;
}
}
if (window2 != NULL)
{
SDL_RenderClear(renderer2);
SDL_RenderPresent(renderer2);
}
SDL_RenderClear(renderer1);
SDL_RenderPresent(renderer1);
}
SDL_DestroyRenderer(renderer1);
SDL_DestroyWindow(window1);
SDL_Quit();
return EXIT_SUCCESS;
} |
This can be reproduced with the testmodal test app as well, by using any Vulkan renderer and simply closing the modal window. This is almost certainly an Nvidia driver bug, given that the crash is happening several calls into their driver, and it's fine under Mesa (you can force the Mesa llvmpipe driver with VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json for testing). e: The Vulkan validation layers don't show any problems either. |
Description
My program crashes upon closing any window that isn't the main one. This problem did not occur when using SDL2, but has occurred with every version of SDL3 since v3.1.3. I held off on reporting this since I figured it would be fixed before the first stable release, but that was not the case.
I am running x86-64 Arch Linux, with an AMD APU and an Nvidia RTX 3050 Ti Mobile GPU. I am using the proprietary Nvidia driver. This crash occurs when using either
SDL_RENDER_DRIVER=vulkan
orSDL_RENDER_DRIVER=gpu
(which internally uses Vulkan). The crash does not occur with the X11 backend, but it does with the Wayland backend.Call Stack
Vulkan
GPU
Minimum Reproducible Example
The text was updated successfully, but these errors were encountered: