Bug 154785 - gamin isn't thread-safe
gamin isn't thread-safe
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gamin (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Veillard
:
Depends On:
Blocks: FC4Target
  Show dependency treegraph
 
Reported: 2005-04-14 00:51 EDT by Nicholas Miell
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 0.0.25
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-20 03:53:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Add some basic locking to libgamin (7.82 KB, patch)
2005-04-14 00:51 EDT, Nicholas Miell
no flags Details | Diff

  None (edit)
Description Nicholas Miell 2005-04-14 00:51:59 EDT
AFAICT, multithreaded clients of libgamin (such as nautilus/gnome-vfs) will
cause libgamin to corrupt the connection's GAMData::req_tab.

The end result in the nautilus/gnome-vfs case is that the wrong userdata pointer
is returned by FAMNextEvent and nautilus will fail to update it's views.

See http://bugzilla.gnome.org/show_bug.cgi?id=172750 for a discussion.

Attached is a half-assed patch which does some basic locking.

Without it, nautilus will stop updating my desktop within about an hour (at
maximum) from my login (less if I fiddle with it). With it, I don't seem to be
able to reproduce  the problem.

Note that this patch may not be suitable for use in gamin; I didn't really
bother to understand libgamin internals, so it probably isn't release-worthy.
However, it does appear to fix my problem, and in the two days that I've been
using it (not stressing it, just using it) nothing bad has happened that I've
noticed.
Comment 1 Nicholas Miell 2005-04-14 00:51:59 EDT
Created attachment 113140 [details]
Add some basic locking to libgamin
Comment 2 Daniel Veillard 2005-04-14 12:45:02 EDT
thanks, I knew it was a potential problem but never checked deeply.
I'm on vacations right now, I will look at the patch and the problem
when I get back. Thanks a lot, if you don't get a answer soon doesn't
mean your patch or the problem is dropped !

Daniel
Comment 3 Daniel Veillard 2005-05-02 10:33:10 EDT
Okay, I have applied the patch, but changed integration for autoconf and 
using gcc tricks to not force the pthread library on applications which are
not multithreaded. It's integrated in CVS at this point but may need a bit more
testing though.

  thanks a lot,

Daniel
Comment 4 Marius Andreiana 2005-08-20 03:37:45 EDT
Reporter, would you please test with current devel?
Comment 5 Daniel Veillard 2005-08-20 03:53:29 EDT
The thread-safety is fixed since 0.0.25 IIRC,

Daniel

Note You need to log in before you can comment on or make changes to this bug.