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 686502 - gnome-shell becomes unresponsive
gnome-shell becomes unresponsive
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 681539 700364 (view as bug list)
Depends on:
Blocks: 687362
 
 
Reported: 2012-10-19 23:13 UTC by Sjoerd Simons
Modified: 2013-05-15 14:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (5.30 KB, patch)
2012-10-19 23:13 UTC, Sjoerd Simons
none Details | Review
fixed patch (5.32 KB, patch)
2012-10-19 23:28 UTC, Sjoerd Simons
reviewed Details | Review

Description Sjoerd Simons 2012-10-19 23:13:16 UTC
Created attachment 226861 [details] [review]
proposed patch

I noticed that in some cases gnome-shell started using 100% just after
startup, which seemingly coincided with the Empathy roster application.
After some more research this turned out to be triggered by the remote
menu.

Every time the _modelChanged function runs through the model it will
connect to action-added for every item which is in the model but not in
the action group. The callback for the action-added signal forces a
refresh of the whole model, which means all items that haven't been
added yet will now have one more signal handler connected.

In my case Empathy has a quite a few items in its menu (caused by the
amount of favourite rooms is have), which meant that the amount of
signal handlers spirals out of control causing gnome-shell to become
unresponsive for long periods of time.
Comment 1 Sjoerd Simons 2012-10-19 23:28:41 UTC
Created attachment 226863 [details] [review]
fixed patch
Comment 2 Giovanni Campagna 2012-10-22 21:25:33 UTC
Review of attachment 226863 [details] [review]:

The original idea was to have at most one signal per menu hierarchy, as we don't rebuild the whole module, just the submenu containing the unknown item, so could you try adding a check in line 1965 and not connect a signal if one was added for a sibling?
Comment 3 Guillaume Desmottes 2012-11-06 11:02:25 UTC
(In reply to comment #2)
> The original idea was to have at most one signal per menu hierarchy, as we
> don't rebuild the whole module, just the submenu containing the unknown item,
> so could you try adding a check in line 1965 and not connect a signal if one
> was added for a sibling?

Is there a good reason to not just rebuild the whole menu or is it just
premature optimization?

This code is pretty hairy already so I'd rather go for a working fix making it
simpler rather than even more complicated. :)
Comment 4 Alban Browaeys 2012-11-21 22:22:54 UTC
*** Bug 681539 has been marked as a duplicate of this bug. ***
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-05-15 14:16:29 UTC
This has been fixed with the GtkMenuTracker port.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-05-15 14:17:02 UTC
*** Bug 700364 has been marked as a duplicate of this bug. ***