A buggy application can crash gnome-shell
Affected version
- OS: Fedora Linux 40 (Workstation Edition)
- Kernel version: 6.8.10-300
- GNOME version: 46.1
- Mesa version: 24.0.8-1
- SDL version: 2.30.1
- CPU: AMD Ryzen 7 5700X
- GPU: AMD Radeon RX 6600XT
- This issue only happens in Wayland
- This issue occurs even when all extensions are disabled
Bug summary
When I run the following C program that uses SDL2 to display a window, then upon trying to close the window, my screens freeze for abount 0,5 seconds, then both screens turn black for 1 second and then I am returned to the login screen. Notice that the program contains a bug because it does not call SDL_Init()
.
#include <stdbool.h>
#include <SDL2/SDL.h>
int main()
{
// SDL_Init(SDL_INIT_VIDEO);
SDL_Window* window;
SDL_Renderer* renderer;
SDL_CreateWindowAndRenderer(1080, 720, SDL_WINDOW_OPENGL, &window, &renderer);
bool quit = false;
while (!quit)
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
quit = true;
break;
default:
break;
}
}
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
}
// SDL_Quit();
}
Steps to reproduce
- Install SDL2 (in my case via
sudo dnf install SDL2-devel
) - Compile the test program (using for example
clang test.c -o test -lSDL2
) - Run the program
- Close the window by pressing the Close button in the titlebar
-
gnome-shell
crashes
This issue is NOT reproducible when...
- I run the program in an X11 session, or...
- I change the program to correctly call
SDL_Init(SDL_INIT_VIDEO)
before doing anything else, or... - I run the program on my laptop, which has all the same software versions, but different hardware (Intel Core i3-10110U with Intel UHD Graphics (CML GT2))
Relevant logs, screenshots, screencasts etc.
Core Dump:
gnome-shell-dump.tar.xz
Stacktrace:
gnome-shell-dump-backtrace.txt
Video: I'm afraid you will have to forgive for filming the screen with my phone.
If there is anything else I can provide that could help debug this issue, I would be happy to provide it.
Edited by Julius Brüggemann