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 589676 - Disabling application monitoring causes endless loop
Disabling application monitoring causes endless loop
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-07-25 09:09 UTC by Jon Nettleton
Modified: 2009-08-28 16:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Save-timer-id-to-remove-it-later-in-app-monitor (963 bytes, patch)
2009-07-28 19:13 UTC, Milan Bouchet-Valat
none Details | Review
Clear save_id when removing idle_save_application_usage() (1012 bytes, patch)
2009-08-18 22:04 UTC, Owen Taylor
committed Details | Review

Description Jon Nettleton 2009-07-25 09:09:16 UTC
I haven't had time to track down the exact code but shortly after disabling usage monitoring for gnome-shell in gconf I would find gnome-shell becoming completely unresponsive and mutter spinning at 100% cpu utilization.  Strace showed mutter endlessly looping on inotify calls looking trying to look in home diectories of other users on my machine.  Re-enabling the gconf key fixed the shell hanging problem.

I promise to get more accurate test data, but wanted to file a bug before I forgot.
Comment 1 Milan Bouchet-Valat 2009-07-28 19:13:06 UTC
Created attachment 139414 [details] [review]
Save-timer-id-to-remove-it-later-in-app-monitor

Looking for obvious causes to that bug, I've discovered a little problem that can lead to the timer not being removed. Then strange things could happen, possibly including the timer being added once again on every call. But I can guarantee that's the fix. Could you try this patch?
Comment 2 Colin Walters 2009-07-31 23:29:48 UTC
I'm tempted to just remove the gconf key entirely; I don't see why we need it.  This code was rewritten in bug 588343 regardless.
Comment 3 Milan Bouchet-Valat 2009-08-01 11:01:15 UTC
I was thinking we needed a way to avoid saving data about app usage, for privacy's sake. That was very to complex to have then. But if we rely on the app monitor to track running apps and show them in the overlay, we can't compeltely stop tracking now this now. Maybe the option should just disable saving stats.
Comment 4 Owen Taylor 2009-08-18 22:01:48 UTC
Comment on attachment 139414 [details] [review]
Save-timer-id-to-remove-it-later-in-app-monitor

It's hard to see how this bug would have triggered an inotify infinite loop. Though without having the old code in front of me, it's hard to say what damage exactly could have been triggered. It's possible that removing random sources could have broken something inside GIO related to file monitoring. (Which is used for the user switching.)

The key seems mostly harmless to me, and I'm not sure I'd bother ripping it out, though I don't foresee adding any UI to control it.

There is one bug somewhat related to the one that Milan was fixing here in the current code. I'll attach a patch.


There's one
Comment 5 Owen Taylor 2009-08-18 22:04:48 UTC
Created attachment 141115 [details] [review]
Clear save_id when removing idle_save_application_usage()

When we remove the timeout for saving application usage when application
usage is disabled, set the save_id member variable to 0.
Comment 6 Owen Taylor 2009-08-28 16:36:12 UTC
Going to resolve this as FIXED, since it's OK as far as we know now, though we never quite tracked down what was going on.