GNOME Bugzilla – Bug 769090
GNOME shell freezes (with 100% CPU usage)
Last modified: 2021-07-05 14:41:43 UTC
Sometimes I unlock the screen and start using gnome-shell only to find that it freezes (for up to 10-15 seconds) every now and then. The gnome-shell process constantly uses about 30% CPU, and when the freeze happens it jumps to 100%. I am using perf to see what is gnome-shell doing in the "frozen" moment. The command is: perf top --pid <pid of gnome shell> This is the "normal" output: http://imgur.com/CsadGZP This is the output right after gnome-shell unfreezes: http://imgur.com/8wIYXv5 The g_main_context_add_poll_unlocked call looks very suspicious... I probably should mention that I don't remember this bug happening on X. It started lately (when I was already using wayland).
Thanks for reporting this! Which exact gnome-shell version is this? Wayland or X? Which distro? > This is the "normal" output: http://imgur.com/CsadGZP > This is the output right after gnome-shell unfreezes: http://imgur.com/8wIYXv5 Could you please paste that output as text here, so it can be found when searching for text? Thanks in advance!
It's gnome-shell 3.20.3 on wayland. Distro is archlinux.
Created attachment 332246 [details] perf.data file produced by `perf record --pid <pid>` command
This bug is driving me crazy (sometimes I start typing something, gnome shell freezes, and when it finally unfreezes I see that I have typed the same letter 100 times). I attached the perf.data file. To see the complete report, run `perf report` from the same folder where perf.data is located. These are the first 50 lines of the report: # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 50K of event 'cycles:u' # Event count (approx.): 21531795889 # # Overhead Command Shared Object Symbol # ........ ............ .................................. ........................................................................... # 18.15% gnome-shell libglib-2.0.so.0.4800.1 [.] g_main_context_add_poll_unlocked 7.59% gnome-shell libc-2.23.so [.] __memset_sse2 4.08% gnome-shell libglib-2.0.so.0.4800.1 [.] g_main_context_remove_poll_unlocked 4.06% gnome-shell libglib-2.0.so.0.4800.1 [.] g_hash_table_lookup 2.27% gnome-shell libglib-2.0.so.0.4800.1 [.] g_slice_alloc 2.09% gnome-shell libc-2.23.so [.] _int_malloc 1.29% gnome-shell libglib-2.0.so.0.4800.1 [.] g_mutex_lock 1.21% gnome-shell libc-2.23.so [.] _int_free 1.18% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_type_check_instance_is_a 1.14% gnome-shell libglib-2.0.so.0.4800.1 [.] g_slice_free1 1.13% gnome-shell libc-2.23.so [.] malloc_consolidate 1.09% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_type_check_instance_is_fundamentally_a 0.95% gnome-shell libglib-2.0.so.0.4800.1 [.] g_pointer_bit_lock 0.93% gnome-shell libc-2.23.so [.] malloc 0.90% gnome-shell libglib-2.0.so.0.4800.1 [.] g_mutex_unlock 0.82% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_signal_emit_valist 0.82% gnome-shell libc-2.23.so [.] __strcmp_sse2_unaligned 0.72% gnome-shell libglib-2.0.so.0.4800.1 [.] g_pointer_bit_unlock 0.69% gnome-shell libpthread-2.23.so [.] pthread_getspecific 0.67% gnome-shell libglib-2.0.so.0.4800.1 [.] g_datalist_id_set_data_full 0.66% gnome-shell libpthread-2.23.so [.] pthread_mutex_lock 0.63% gnome-shell libglib-2.0.so.0.4800.1 [.] g_private_get 0.61% gnome-shell libc-2.23.so [.] free 0.60% gnome-shell libglib-2.0.so.0.4800.1 [.] g_hash_table_insert_internal 0.52% gnome-shell libc-2.23.so [.] __libc_calloc 0.50% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_object_unref 0.49% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_type_value_table_peek 0.48% gnome-shell libglib-2.0.so.0.4800.1 [.] g_hash_table_lookup_extended 0.48% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_closure_unref 0.46% gnome-shell libglib-2.0.so.0.4800.1 [.] g_slice_free_chain_with_offset 0.44% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_object_ref 0.44% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_object_new_internal 0.42% gnome-shell libglib-2.0.so.0.4800.1 [.] block_source 0.40% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_closure_ref 0.39% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_closure_invalidate 0.37% gnome-shell libgobject-2.0.so.0.4800.1 [.] g_object_new_valist 0.36% gnome-shell [kernel.vmlinux] [k] entry_SYSCALL_64 0.35% gnome-shell libglib-2.0.so.0.4800.1 [.] g_str_hash 0.34% gnome-shell libglib-2.0.so.0.4800.1 [.] g_slice_alloc0
Created attachment 349528 [details] perf data of gnome-shell freeze Can confirm the existence of the bug, I encountered it in both f25 gnome3.22.2 and on f26 alpha gnome3.24 running on wayland. Sometimes it freezes and never recovers, others it come back after 10-20sec. I managed to record a perf dataset from when it completely froze
Created attachment 349563 [details] Screen log from and threads bt from the freeze Additional screenlog from another freeze, this time under X.org 1.19.3-2.fc26, gnome-shell 3.24.0. Includes threads backtrace, gjs_dumpstack segfaulted
(In reply to Jordan from comment #5) > Created attachment 349528 [details] > perf data of gnome-shell freeze > > Can confirm the existence of the bug, I encountered it in both f25 > gnome3.22.2 and on f26 alpha gnome3.24 running on wayland. Sometimes it > freezes and never recovers, others it come back after 10-20sec. I managed to > record a perf dataset from when it completely froze Can you attach a report from that perf.data? I can only see addresses here, no symbols. (In reply to Jordan from comment #6) > Created attachment 349563 [details] > Screen log from and threads bt from the freeze > > Additional screenlog from another freeze, this time under X.org > 1.19.3-2.fc26, gnome-shell 3.24.0. > Includes threads backtrace, gjs_dumpstack segfaulted AFAICS, the main thread is recalculating the GTK style context used by window frames. Not sure why that would take any significant amount of time. All others are idling.
(In reply to Jonas Ådahl from comment #7) > AFAICS, the main thread is recalculating the GTK style context used by > window frames. Not sure why that would take any significant amount of time. Bug 780254 maybe?
(In reply to Florian Müllner from comment #8) > (In reply to Jonas Ådahl from comment #7) > > AFAICS, the main thread is recalculating the GTK style context used by > > window frames. Not sure why that would take any significant amount of time. > > Bug 780254 maybe? Looks like it. Should it be pushed to the 3.22 branch too maybe? *** This bug has been marked as a duplicate of bug 780254 ***
Closed as duplicate too quickly; this bug is really about two issues. The infinite freeze is probably bug 780254, but the 10-20 seconds freeze I'd assume is something different. William, are you still experiencing the temporary freeze?
I don't remember experiencing this issue lately (sometimes when the CPU is *actually* working 100% I can notice a key press being stuck and then the same letter appears ten times or so, but I wouldn't say it's the same issue as this). I have to say though, that I changed laptop since opening this issue (now I'm on the XPS 13) and I'm now using GNOME shell 3.22, so that may contribute to me not seeing this issue anymore.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.