[Xwayland] on a non-active VT, sometimes enters infinite loop inside xwl_screen_init()
Sometimes I run more than one gnome session at once - different users on different Virtual Terminals.
- Occasionally, gnome-shell for a non-active VT starts using 100% CPU. Or, actually 99% CPU because it's doing IPC as well. And the corresponding XWayland uses 40% CPU.
- It is still possible to switch to the buggy gnome session and continue using it. This does not stop the busy-looping. I haven't noticed what happens with legacy X11 apps though.
- Sending SIGSTOP to either gnome-shell or XWayland, stops the other one from busy-looping.
- I don't know how to reproduce it. Though, I guess it requires running an X11 app at some point, because gnome-shell only starts Xwayland on-demand.
I rebuilt libwayland with debugging symbols. This may well not be enough to debug, because I did not have symbols for Xwayland yet.
gnome-shell is repeatedly getting display_sync() (wl_display::sync ?), and responding "done" (wl_callback::done ?).
Xwayland is repeatedly calling wl_display_sync(). Using the "finish" command in gdb, shows Xwayland is stuck looping inside xwl_screen_init().
Before receiving the "done", Xwayland also receives "delete_id" (wl_display::delete_id ?).
#4 0x00007f7080a79d17 in wl_display_sync (wl_display=0x55d2cc37d8f0) at src/wayland-client-protocol.h:1038
#5 wl_display_roundtrip_queue (display=0x55d2cc374350, queue=0x55d2cc374420) at ../src/wayland-client.c:1350
#6 0x00007f7080a79dc0 in wl_display_roundtrip (display=<optimised out>) at ../src/wayland-client.c:1387
#7 0x000055d2cbb0ce84 in xwl_screen_roundtrip (xwl_screen=0x55d2cc36d550) at ../hw/xwayland/xwayland-screen.c:577
#8 xwl_screen_init (argv=<optimised out>, argc=<optimised out>, pScreen=0x55d2cc36cf00) at ../hw/xwayland/xwayland-screen.c:685
#9 xwl_screen_init (pScreen=0x55d2cc36cf00, argc=<optimised out>, argv=<optimised out>) at ../hw/xwayland/xwayland-screen.c:584
#10 0x000055d2cbaffbad in AddScreen (pfnInit=<optimised out>, argv=0x7ffdb3d5d398, argc=16) at ../dix/dispatch.c:3992
#11 InitOutput (screen_info=<optimised out>, argv=0x7ffdb3d5d398, argc=16) at ../hw/xwayland/xwayland.c:312
#12 dix_main (envp=<optimised out>, argv=<optimised out>, argc=<optimised out>) at ../dix/main.c:189
#13 main (argc=<optimised out>, argv=<optimised out>, envp=<optimised out>) at ../dix/stubmain.c:34
- Ubuntu 22.04.4 LTS
- Xwayland 2:22.1.1-1ubuntu0.11
- libwayland-client0 1.20.0-1ubuntu0.1
- gnome-shell 42.9-0ubuntu2