Assert failure when removing an external monitor
How to reproduce:
- Use the atomic DRM backend
- Have an external monitor connected
- Unplug the cable
This assert failure is very rare, probably a race condition:
(gdb) bt
#0 0x00007f55b2bd5d22 in raise () at /usr/lib/libc.so.6
#1 0x00007f55b2bbf862 in abort () at /usr/lib/libc.so.6
#2 0x00007f55b2bbf747 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3 0x00007f55b2bce616 in () at /usr/lib/libc.so.6
#4 0x00007f55b2d80ab1 in atomic_flip_handler (fd=<optimized out>, frame=<optimized out>, sec=8624, usec=271161, crtc_id=51, data=0x563cfc65e430) at ../libweston/backend-drm/kms.c:1395
#5 0x00007f55b281fc87 in drmHandleEvent () at /usr/lib/libdrm.so.2
#6 0x00007f55b2d75b25 in on_drm_input (fd=<optimized out>, mask=<optimized out>, data=<optimized out>) at ../libweston/backend-drm/kms.c:1414
#7 0x00007f55b2b2f902 in wl_event_loop_dispatch (loop=0x563cfc64ef60, timeout=timeout@entry=-1) at ../wayland/src/event-loop.c:1027
#8 0x00007f55b2b2cce7 in wl_display_run (display=display@entry=0x563cfc654f40) at ../wayland/src/wayland-server.c:1364
#9 0x00007f55b2da7895 in wet_main (argc=<optimized out>, argv=0x7ffc7240d918, test_data=0x0) at ../compositor/main.c:3503
#10 0x00007f55b2bc0b25 in __libc_start_main () at /usr/lib/libc.so.6
#11 0x0000563cfae2805e in _start ()