Bug 154785

Summary: gamin isn't thread-safe
Product: [Fedora] Fedora Reporter: Nicholas Miell <nmiell>
Component: gaminAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: marius.andreiana
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.0.25 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-20 07:53:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 136451    
Attachments:
Description Flags
Add some basic locking to libgamin none

Description Nicholas Miell 2005-04-14 04:51:59 UTC
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 04:51:59 UTC
Created attachment 113140 [details]
Add some basic locking to libgamin

Comment 2 Daniel Veillard 2005-04-14 16:45:02 UTC
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 14:33:10 UTC
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 07:37:45 UTC
Reporter, would you please test with current devel?

Comment 5 Daniel Veillard 2005-08-20 07:53:29 UTC
The thread-safety is fixed since 0.0.25 IIRC,

Daniel