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 669292 - gam_server deadlocks
gam_server deadlocks
Status: RESOLVED DUPLICATE of bug 667230
Product: gamin
Classification: Other
Component: general
0.1.x
Other Linux
: Normal normal
: ---
Assigned To: Gamin Maintainer(s)
Gamin Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-02-03 08:10 UTC by Sandro Mani
Modified: 2014-11-04 15:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (828 bytes, patch)
2012-02-03 08:11 UTC, Sandro Mani
none Details | Review
Backtrace (52 bytes, text/plain)
2012-02-03 08:12 UTC, Sandro Mani
  Details

Description Sandro Mani 2012-02-03 08:10:06 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
Comment 1 Sandro Mani 2012-02-03 08:11:16 UTC
Created attachment 206676 [details] [review]
Patch
Comment 2 Sandro Mani 2012-02-03 08:12:04 UTC
Created attachment 206677 [details]
Backtrace
Comment 3 Tomas Bzatek 2012-02-08 16:16:01 UTC
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...
Comment 4 Anssi Hannula 2012-04-06 20:58:26 UTC
Tomas, that is exactly what my patch in bug #667230 for this exact same issue does :)
Comment 5 Daniel Elstner 2014-11-04 15:49:35 UTC

*** This bug has been marked as a duplicate of bug 667230 ***