Comment 4 for bug 1296233

Charles Kerr (charlesk) wrote :

So, by adding a breakpoint for g_timeout_dispatch, it does look like gio's im_scan_missing is being called every four seconds. (glib/gio/inotify/inotify-missing.c's inotify_add() calls g_timeout_source_new_seconds(SCAN_MISSING_TIME) where SCAN_MISSING_TIME is #define'd to 4.

inotify-missing is watching for these directories to be created:

  * /usr/share/ubuntu/applications
  * /usr/local/share/applications

The backtrace shows that _im_add() is being called from this path:

#0 _im_add (sub=sub@entry=0x82d5d38) at /build/buildd/glib2.0-2.39.92/./gio/inotify/inotify-missing.c:60
#1 0xb7db2547 in _ih_sub_add (sub=sub@entry=0x82d5d38) at /build/buildd/glib2.0-2.39.92/./gio/inotify/inotify-helper.c:109
#2 0xb7db29ed in g_inotify_directory_monitor_start (local_monitor=0x828b038)
    at /build/buildd/glib2.0-2.39.92/./gio/inotify/ginotifydirectorymonitor.c:90
#3 0xb7da2f00 in g_local_directory_monitor_start (local_monitor=0x828b038)
    at /build/buildd/glib2.0-2.39.92/./gio/glocaldirectorymonitor.c:119
#4 0xb7d41acc in desktop_file_dir_init (dir=0x82a20c4) at /build/buildd/glib2.0-2.39.92/./gio/gdesktopappinfo.c:847
#5 desktop_file_dirs_lock () at /build/buildd/glib2.0-2.39.92/./gio/gdesktopappinfo.c:939
#6 0xb7d43c9f in desktop_file_dirs_refresh () at /build/buildd/glib2.0-2.39.92/./gio/gdesktopappinfo.c:951
#7 mime_info_cache_init_dir_lists () at /build/buildd/glib2.0-2.39.92/./gio/gdesktopappinfo.c:4086
#8 mime_info_cache_init () at /build/buildd/glib2.0-2.39.92/./gio/gdesktopappinfo.c:4130
#9 get_all_desktop_entries_for_mime_type (base_mime_type=base_mime_type@entry=0x82306c7 "text/calendar",
    include_fallback=include_fallback@entry=1, explicit_default=explicit_default@entry=0xbfffe96c, except=0x0)
    at /build/buildd/glib2.0-2.39.92/./gio/gdesktopappinfo.c:4234
#10 0xb7d45ad9 in g_app_info_get_all_for_type (content_type=0x82306c7 "text/calendar")
    at /build/buildd/glib2.0-2.39.92/./gio/gdesktopappinfo.c:3363

...meaning that, once indicator-datetime makes the mistake of calling g_app_info_get_all_for_type(), glib will keep polling "/usr/share/ubuntu/applications" and "/usr/local/share/applications" every four seconds forever, even though the app doesn't use that mime information again. :/