Swapchain is NULL in wlr_output_commit_state() when re-enabling scanout, causing SIGSEGV
- Start tinywl (also reproducible in Sway, with a different setup)
- Open a toplevel that can be scanned out (I used mpv with a 1280x720 video)
Direct scan-out enabled
- Disable scanout by resizing the window
- Easy to do by switching from floating to tiled
Direct scan-out disabled
- Enable scanout again
- Switch from tiled back to floating
Thread 1 "tinywl" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e8086e in swapchain_has_buffer (swapchain=0x0, buffer=0x7fffec817010) at ../render/swapchain.c:119
119 if (slot->buffer == buffer) {
(gdb) bt
#0 0x00007ffff7e8086e in swapchain_has_buffer (swapchain=0x0, buffer=0x7fffec817010) at ../render/swapchain.c:119
#1 0x00007ffff7e808e3 in wlr_swapchain_set_buffer_submitted (swapchain=0x0, buffer=0x7fffec817010) at ../render/swapchain.c:130
#2 0x00007ffff7ebd9ea in wlr_output_commit_state (output=0x7fffeadbd970, state=0x7fffffffe110) at ../types/output/output.c:821
#3 0x00007ffff7ebdb2e in wlr_output_commit (output=0x7fffeadbd970) at ../types/output/output.c:853
#4 0x00007ffff7ec3d75 in scene_node_try_direct_scanout (node=0x7fffeaac97d0, scene_output=0x7fffeada6990, box=0x7fffffffe360) at ../types/scene/wlr_scene.c:1384
#5 0x00007ffff7ec3f36 in wlr_scene_output_commit (scene_output=0x7fffeada6990) at ../types/scene/wlr_scene.c:1416
#6 0x00005555555575fd in output_frame (listener=0x7fffec5ae0a0, data=0x7fffeadbd970) at ../tinywl/tinywl.c:558
#7 0x00007ffff7e4498c in wl_signal_emit_mutable (signal=<optimized out>, data=0x7fffeadbd970) at ../src/wayland-server.c:2177
#8 0x00007ffff7ebdc3b in wlr_output_send_frame (output=0x7fffeadbd970) at ../types/output/output.c:878
#9 0x00007ffff7ebdc7f in schedule_frame_handle_idle_timer (data=0x7fffeadbd970) at ../types/output/output.c:886
#10 0x00007ffff7e4678b in wl_event_loop_dispatch_idle (loop=loop@entry=0x7ffff7dfab90) at ../src/event-loop.c:969
#11 0x00007ffff7e468aa in wl_event_loop_dispatch (loop=0x7ffff7dfab90, timeout=timeout@entry=-1) at ../src/event-loop.c:1032
#12 0x00007ffff7e443c5 in wl_display_run (display=0x7ffff7f60e80) at ../src/wayland-server.c:1429
#13 0x00005555555584fa in main (argc=1, argv=0x7fffffffe948) at ../tinywl/tinywl.c:976
wlr_swapchain_set_buffer_submitted()
is called with NULL swapchain.