GNOME Bugzilla – Bug 669292
gam_server deadlocks
Last modified: 2014-11-04 15:49:35 UTC
Description of problem: Occasionally, gam_server deadlocks (see attached backtrace). When this happens, all KDE applications hang at start. Killing gam_server allows the user to regain an operational desktop. Version-Release number of selected component (if applicable): gamin-0.1.10-11.fc17.x86_64 How reproducible: Infrequently Steps to Reproduce: Hard, it appears to be more likely to happen when attempting to launch a KDE application when the machine is out of RAM and swapping. Actual results: gam_server hangs, an so do all applications using it (i.e. attempt to connect to /tmp/fam-$username-) Additional info: Looking at gamin-0.1.10/server/inotify-helper.c, there is an obvious double lock: ih_sub_foreach_worker locks inotify_lock on line 153, and calls ih_sub_cancel on line 162, which also attempts to lock inotify_lock on line 130. The backtrace indeed shows that gam_server is stuck ad inotify-helper.c::130. I would suggest removing the G_LOCK and G_UNLOCK in ih_sub_cancel, since it is only called by ih_sub_foreach_worker anyway. I have made a corresponding patch. - Backtrace attached - Patch attached
Created attachment 206676 [details] [review] Patch
Created attachment 206677 [details] Backtrace
The patch is correct in the current state - i.e. ih_sub_cancel() is only called from ih_sub_foreach_worker() which holds the lock already. But to be on the safe side, ih_sub_cancel() should be probably marked as static and removed from inotify-helper.h to prevent calling from other places. Just my 0.02 CZK...
Tomas, that is exactly what my patch in bug #667230 for this exact same issue does :)
*** This bug has been marked as a duplicate of bug 667230 ***