[Bug 2043517] Re: gnome-shell on non-active VT busy-loops through libwayland-server.so (sometimes)
Alessandro Astone
2043517 at bugs.launchpad.net
Fri Dec 13 12:42:33 UTC 2024
** Changed in: xwayland (Ubuntu)
Importance: Undecided => Medium
** Changed in: xwayland (Ubuntu Jammy)
Importance: Undecided => Medium
** Changed in: xwayland (Ubuntu Noble)
Importance: Undecided => Medium
** Changed in: xwayland (Ubuntu Oracular)
Importance: Undecided => Medium
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2043517
Title:
gnome-shell on non-active VT busy-loops through libwayland-server.so
(sometimes)
Status in X.Org X server:
Fix Released
Status in mutter package in Ubuntu:
Won't Fix
Status in xwayland package in Ubuntu:
In Progress
Status in mutter source package in Jammy:
Won't Fix
Status in xwayland source package in Jammy:
In Progress
Status in mutter source package in Noble:
Won't Fix
Status in xwayland source package in Noble:
In Progress
Status in mutter source package in Oracular:
Won't Fix
Status in xwayland source package in Oracular:
In Progress
Bug description:
[ Impact ]
gnome-shell running on an inactive VT will sometimes start using 100% CPU.
When that happens, the Xwayland child process is seen using 40% CPU.
[ Test Plan ]
1. Log in to GNOME Wayland
2. Open a terminal window
3. Terminate Xwayland if it was automatically started:
$ pkill -SIGTERM Xwayland
4. Run the following command:
$ sleep 5; xlsclients
5. Within 5 seconds, switch TTY with Ctrl+Alt+F3
6. Log-in to the terminal
7. Run:
$ top -p $(pidof gnome-shell)
8. Verify that gnome-shell is using close to 0% CPU, for at least 5 seconds.
9. Return to GNOME by switching TTY with Ctrl+Alt+F2
10. Verify that the `xlsclients` command has terminated
[ Where problems could occur ]
Xwayland is used to run X11 applications in a Wayland desktop.
If Xwayland is malfunctioning, you will notice by not being able to run X11 apps anymore.
In a Wayland desktop those would typically be legacy electron-based or java-based apps.
[ Original Bug Report ]
I run several gnome sessions at once - different users on different
Virtual Terminals.
Sometimes, 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.
FWIW, sending SIGSTOP to either gnome-shell or XWayland stops the
other one from busy-looping as well.
If I switch back to the affected VT, it appears to function fine, but
it is still using 100% + 40% CPU.
Version numbers:
Ubuntu 22.04.3 LTS
gnome-shell 42.9-0ubuntu2
xwayland 2:22.1.1-1ubuntu0.7
$ ps -aux | grep 'alan .*gnome-shell$'
alan 9248 26.1 3.4 5492888 269136 ? Rsl 19:54 30:26 /usr/bin/gnome-shell
$ sudo strace -p 9248 2>&1|head
strace: Process 9248 attached
epoll_wait(37, [{events=EPOLLIN, data={u32=403234816, u64=139797293752320}}], 32, 0) = 1
recvmsg(21, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\0\0\0\0\0\f\0\3\0\0\0", iov_len=752}, {iov_base="", iov_len=3344}], msg_iovlen=2, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_CMSG_CLOEXEC) = 12
write(4, "\1\0\0\0\0\0\0\0", 8) = 8
sendmsg(21, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\3\0\0\0\0\0\f\0[\2\0\0\1\0\0\0\1\0\f\0\3\0\0\0", iov_len=24}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 24
poll([{fd=4, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=19, events=POLLIN}, {fd=20, events=POLLIN}, {fd=23, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=34, events=POLLIN}, {fd=36, events=POLLIN}, {fd=37, events=POLLIN}, {fd=54, events=POLLIN}, {fd=63, events=POLLIN}, {fd=66, events=POLLIN}], 14, 79809702) = 2 ([{fd=4, revents=POLLIN}, {fd=37, revents=POLLIN}])
read(4, "\2\0\0\0\0\0\0\0", 16) = 8
write(4, "\1\0\0\0\0\0\0\0", 8) = 8
epoll_wait(37, [{events=EPOLLIN, data={u32=403234816, u64=139797293752320}}], 32, 0) = 1
The recvmsg() call is here:
#0 __libc_recvmsg (fd=21, msg=0x7fff1de64a50, flags=1073741888) at ../sysdeps/unix/sysv/linux/recvmsg.c:35
#1 0x00007f2531ea5ad6 in () at /lib/x86_64-linux-gnu/libwayland-server.so.0
#2 0x00007f2531ea4eea in wl_event_loop_dispatch () at /lib/x86_64-linux-gnu/libwayland-server.so.0
#3 0x00007f2531d2b45b in wayland_event_source_dispatch (base=<optimised out>, callback=<optimised out>, data=<optimised out>)
at ../src/wayland/meta-wayland.c:110
#4 0x00007f2532b42d3b in g_main_dispatch (context=0x55c0046cc8f0) at ../../../glib/gmain.c:3419
#5 g_main_context_dispatch (context=0x55c0046cc8f0) at ../../../glib/gmain.c:4137
#6 0x00007f2532b98258 in g_main_context_iterate.constprop.0
(context=0x55c0046cc8f0, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimised out>) at ../../../glib/gmain.c:4213
#7 0x00007f2532b422b3 in g_main_loop_run (loop=0x55c00698ae30) at ../../../glib/gmain.c:4413
#8 0x00007f2531cd0b79 in meta_context_run_main_loop (context=context at entry=0x55c0046c70c0, error=error at entry=0x7fff1de64f08)
at ../src/core/meta-context.c:437
#9 0x000055c003cf4f12 in main (argc=<optimised out>, argv=<optimised out>) at ../src/main.c:650
The sendmsg() call is here:
Thread 1 "gnome-shell" hit Breakpoint 1, __libc_sendmsg (fd=21, msg=0x7fff1de64c50, flags=16448) at ../sysdeps/unix/sysv/linux/sendmsg.c:26
26 ../sysdeps/unix/sysv/linux/sendmsg.c: No such file or directory.
(gdb) where
#0 __libc_sendmsg (fd=21, msg=0x7fff1de64c50, flags=16448) at ../sysdeps/unix/sysv/linux/sendmsg.c:26
#1 0x00007f2531ea1c9d in () at /lib/x86_64-linux-gnu/libwayland-server.so.0
#2 0x00007f2531ea565e in wl_display_flush_clients () at /lib/x86_64-linux-gnu/libwayland-server.so.0
#3 0x00007f2531d2b437 in wayland_event_source_prepare (base=base at entry=0x55c004a374d0, timeout=timeout at entry=0x7fff1de64dc4)
at ../src/wayland/meta-wayland.c:97
#4 0x00007f2532b428e7 in g_main_context_prepare (context=0x55c0046cc8f0, priority=0x7fff1de64e50) at ../../../glib/gmain.c:3739
#5 0x00007f2532b98123 in g_main_context_iterate.constprop.0
(context=0x55c0046cc8f0, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimised out>) at ../../../glib/gmain.c:4193
#6 0x00007f2532b422b3 in g_main_loop_run (loop=0x55c00698ae30) at ../../../glib/gmain.c:4413
#7 0x00007f2531cd0b79 in meta_context_run_main_loop (context=context at entry=0x55c0046c70c0, error=error at entry=0x7fff1de64f08)
at ../src/core/meta-context.c:437
#8 0x000055c003cf4f12 in main (argc=<optimised out>, argv=<optimised out>) at ../src/main.c:650
To manage notifications about this bug go to:
https://bugs.launchpad.net/xorg-server/+bug/2043517/+subscriptions
More information about the Ubuntu-sponsors
mailing list