GNOME Bugzilla – Bug 661619
glib trying to put inotify watch on old directory
Last modified: 2018-05-24 13:27:04 UTC
Created attachment 198900 [details] gdb stack trace of firefox being hung I'm bringing this bug from firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=692545). What appears to be happening is that when using a GTK file selection dialog, an inotify watch is being added to the directory, and then after the dialog is closed, glib still tries to keep the inotify watch on the directory as a result of im_scan_missing(). This can result in the application hanging if the inotify watch is being put on an autofs mount which is no longer available (the watch hangs until automount returns). This behavior has been observed in firefox and evince. I am including 3 attachments. The first is a stack trace of firefox being hung after the autofs mount becomes unavailable. The file selection dialog had been closed, and there are no open file handles on the mount point. I simulated the mount going unavailable by unmounting and then putting in an iptables DROP rule for traffic to the network share. The second attachment is firefox opening the file selection dialog with a break point on ip_watched_dir_new. The third attachment is also a break point on ip_watched_dir_new, but this break triggered a few seconds after the mount was unmounted and made unavailable.
Created attachment 198901 [details] break point on ip_watched_dir_new opening file selection dialog
Created attachment 198902 [details] break point on ip_watched_dir_new after unmounting
Oh, forgot to put the exact version of glib. Its 2.28.8
This could happen because gtk+ is leaking inotify watches. Note also if told to watch a nonexistent file, gio internally will periodically poll.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/463.