After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769090 - GNOME shell freezes (with 100% CPU usage)
GNOME shell freezes (with 100% CPU usage)
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2016-07-22 15:59 UTC by William Di Luigi
Modified: 2021-07-05 14:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
perf.data file produced by `perf record --pid <pid>` command (2.13 MB, application/octet-stream)
2016-07-27 23:13 UTC, William Di Luigi
Details
perf data of gnome-shell freeze (771.16 KB, application/octet-stream)
2017-04-08 18:10 UTC, Jordan Petridis
Details
Screen log from and threads bt from the freeze (27.65 KB, application/octet-stream)
2017-04-09 18:02 UTC, Jordan Petridis
Details

Description William Di Luigi 2016-07-22 15:59:02 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).
Comment 1 André Klapper 2016-07-23 13:22:40 UTC
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!
Comment 2 William Di Luigi 2016-07-23 19:57:04 UTC
It's gnome-shell 3.20.3 on wayland. Distro is archlinux.
Comment 3 William Di Luigi 2016-07-27 23:13:49 UTC
Created attachment 332246 [details]
perf.data file produced by `perf record --pid <pid>` command
Comment 4 William Di Luigi 2016-07-27 23:18:51 UTC
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
Comment 5 Jordan Petridis 2017-04-08 18:10:48 UTC
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
Comment 6 Jordan Petridis 2017-04-09 18:02:08 UTC
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
Comment 7 Jonas Ådahl 2017-04-10 03:21:30 UTC
(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.
Comment 8 Florian Müllner 2017-04-10 09:01:28 UTC
(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?
Comment 9 Jonas Ådahl 2017-04-10 09:12:03 UTC
(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 ***
Comment 10 Jonas Ådahl 2017-04-10 09:14:38 UTC
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?
Comment 11 William Di Luigi 2017-04-10 09:49:55 UTC
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.
Comment 12 GNOME Infrastructure Team 2021-07-05 14:41:43 UTC
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.