CPU spikes and system hangs from gnome-shell every 5-10 seconds

Bug #1899184 reported by Radon Rosborough
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

On a fresh installation of Ubuntu 20.04 with no configuration files changed yet (the "install third-party software" option enabled), installed from the official daily ISO, the system freezes for about a second every 5-10 seconds and I see a spike to 70% or more CPU usage by gnome-shell. I cannot see anything that shows up in `sudo journalctl -ef` or `sudo dmesg -w` when the freezes occur. The problem reproduces on both X11 and Wayland, although under Wayland it's more annoying since a freeze leads to repeated keypresses of whatever key was being held down on the keyboard at the time of the freeze.

This problem seems to have been reported at <https://www.reddit.com/r/pop_os/comments/gwfn7l/gnome_shell_random_cpu_spikes_every_10_seconds/> but with no plausible resolution or workaround in sight.

I tried to follow <https://superuser.com/q/1046603> to figure out what was going on with gnome-shell, but I don't think the results seem very helpful.

Result of `sudo perf top`:

    4.39% libglib-2.0.so.0.6400.3 [.] g_variant_serialised_n_children
    4.26% libc-2.31.so [.] __vfprintf_internal

And `sudo perf top --sort comm,dso`:

    45.28% gnome-shell libglib-2.0.so.0.6400.3
    17.23% gnome-shell libc-2.31.so

And `sudo perf record -g -p PID` for the `gnome-shell` PID:

    + 39.81% 0.01% [unknown] [.] 0000000000000000
    + 14.26% 2.04% libc-2.31.so [.] __vasprintf_internal
    + 8.61% 8.42% libglib-2.0.so.0.6400.3 [.] g_variant_serialised_n_children
    + 8.51% 8.09% libc-2.31.so [.] __vfprintf_internal

And `strace -c -p PID`:

    % time seconds usecs/call calls errors syscall
    ------ ----------- ----------- --------- --------- ----------------
     34.41 0.128602 5 22784 19837 recvmsg
     25.74 0.096215 7 13716 632 ioctl
     18.04 0.067420 10 6686 poll
      9.50 0.035523 7 4858 write
      4.56 0.017025 7 2322 writev

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: gnome-shell 3.36.4-1ubuntu1~20.04.2
ProcVersionSignature: Ubuntu 5.4.0-49.53-generic 5.4.65
Uname: Linux 5.4.0-49-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.10
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Fri Oct 9 07:54:43 2020
DisplayManager: gdm3
InstallationDate: Installed on 2020-10-09 (0 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20201007)
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/usr/bin/zsh
RelatedPackageVersions: mutter-common 3.36.6-1ubuntu0.20.04.2
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Radon Rosborough (raxod502) wrote :
description: updated
Revision history for this message
Radon Rosborough (raxod502) wrote :

Reattached GsettingsChanges.txt since the apport version contained private information.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It looks like the freezes could be a separate problem to the CPU spikes. Because these look like input freezes:

[ 6939.689860] shallan gnome-shell[15054]: _clutter_stage_queue_event: assertion 'CLUTTER_IS_STAGE (stage)' failed
[ 6939.689984] shallan gnome-shell[15054]: clutter_do_event: Event does not have a stage: discarding.
[ 6939.699761] shallan gnome-shell[15054]: _clutter_stage_queue_event: assertion 'CLUTTER_IS_STAGE (stage)' failed
[ 6939.699930] shallan gnome-shell[15054]: clutter_do_event: Event does not have a stage: discarding.
[ 6939.729329] shallan gnome-shell[15054]: _clutter_stage_queue_event: assertion 'CLUTTER_IS_STAGE (stage)' failed
[ 6939.729490] shallan gnome-shell[15054]: clutter_do_event: Event does not have a stage: discarding.

but I don't know how that could cause high CPU.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We will need more information about the affected machine. When the problem is happening please run:

  journalctl -b0 > journal.txt
  lspci -kv > lspci.txt
  xrandr --verbose > xrandr.txt

and then attach the resulting text files here.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please also tell us what extensions you have enabled, if any.

Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Revision history for this message
Radon Rosborough (raxod502) wrote :

No extensions were installed aside from whatever came with Ubuntu by default. Unfortunately, I can't provide the requested debugging information at present since I've installed Kubuntu, which does not exhibit the same problem. Hopefully somebody else with the same issue can chime in, however.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If anyone else experiences similar issues they should open a new bug.

Changed in gnome-shell (Ubuntu):
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.