SDL App crashes when turning off/on external monitor
Affected version
[~ (0) ]$ cat /etc/redhat-release
Fedora release 38 (Thirty Eight)
[~ (0) ]$ gnome-shell --version
GNOME Shell 44.3
gnome on Wayland
Bug summary
I'm using PPSSPP compiled using SDL renderer. I've noticed that when I rutn off my screen and then turn it back on, app crashes with segfault Reference issue in PPSSPP repo
Steps to reproduce
- clone PPSSPP
- run
./b.sh
cd build;./PPSSPPSDL
- turn off and back on your external monitor
What happened
crash. Here is backtrace from gdb:
Thread 1 "PPSSPPSDL" received signal SIGSEGV, Segmentation fault.
0x00007ffff7db9b0c in decoration_frame_configure (frame=0x1b7e440, configuration=0x23c79d0, user_data=0x1a06fb0) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/video/wayland/SDL_waylandwindow.c:823
823 driverdata = (SDL_WaylandOutputData *) SDL_GetDisplayForWindow(window)->driverdata;
(gdb) bt
#0 0x00007ffff7db9b0c in decoration_frame_configure (frame=0x1b7e440, configuration=0x23c79d0, user_data=0x1a06fb0) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/video/wayland/SDL_waylandwindow.c:823
#1 0x00007ffff6b0a9cc in xdg_surface_configure (user_data=0x1b7e440, xdg_surface=<optimized out>, serial=313) at ../src/libdecor.c:347
#2 0x00007ffff6af8be6 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#3 0x00007ffff6af54bf in ffi_call_int (cif=cif@entry=0x7fffffffb590, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673
#4 0x00007ffff6af818e in ffi_call (cif=cif@entry=0x7fffffffb590, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0x7fffffffb660) at ../src/x86/ffi64.c:710
#5 0x00007ffff6b27f0e in wl_closure_invoke (closure=closure@entry=0x19e7c80, target=<optimized out>, target@entry=0x1b7e370, opcode=opcode@entry=0, data=<optimized out>, flags=1) at ../src/connection.c:1025
#6 0x00007ffff6b28793 in dispatch_event (display=display@entry=0x19ddd20, queue=0x19dde10) at ../src/wayland-client.c:1631
#7 0x00007ffff6b28a3c in dispatch_queue (queue=0x19dde10, display=0x19ddd20) at ../src/wayland-client.c:1777
#8 wl_display_dispatch_queue_pending (display=display@entry=0x19ddd20, queue=queue@entry=0x19dde10) at ../src/wayland-client.c:2019
#9 0x00007ffff6b28aa0 in wl_display_dispatch_pending (display=display@entry=0x19ddd20) at ../src/wayland-client.c:2082
#10 0x00007ffff6ce493a in libdecor_plugin_cairo_dispatch (plugin=<optimized out>, timeout=0) at ../src/plugins/cairo/libdecor-cairo.c:515
#11 0x00007ffff7eaa51f in Wayland_PumpEvents (_this=<optimized out>) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/video/wayland/SDL_waylandevents.c:369
#12 0x00007ffff7de26f0 in SDL_PumpEventsInternal (push_sentinel=push_sentinel@entry=SDL_TRUE) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/events/SDL_events.c:867
#13 0x00007ffff7de2ade in SDL_WaitEventTimeout_REAL (event=0x7fffffffbce0, timeout=0) at /usr/src/debug/SDL2-2.26.3-1.fc38.x86_64/src/events/SDL_events.c:1046
#14 0x0000000000484c98 in main ()
(gdb)
What did you expect to happen
nothing should crash