Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 183710 - Applications depending on fuse-python don't really work
Summary: Applications depending on fuse-python don't really work
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Markus Ullmann (RETIRED)
URL: http://fuse.sourceforge.net/wiki/inde...
Whiteboard:
Keywords:
: 185944 (view as bug list)
Depends on: 183924
Blocks: 183705 63785 112550 183699 196627
  Show dependency tree
 
Reported: 2007-06-30 05:47 UTC by Josh Glover (RETIRED)
Modified: 2008-04-21 20:21 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fuse-python-0.2.ebuild (fuse-python-0.2.ebuild,623 bytes, text/plain)
2007-06-30 05:51 UTC, Josh Glover (RETIRED)
Details
fuse-python-0.1.ebuild (fuse-python-0.1.ebuild,769 bytes, text/plain)
2007-07-02 01:38 UTC, Josh Glover (RETIRED)
Details
Fixes compile errors (fuse-python-0.1.patch,274 bytes, patch)
2007-07-02 01:39 UTC, Josh Glover (RETIRED)
Details | Diff
Example demonstrating threading problem with fuse-python 0.2 (xmp.py,8.61 KB, text/plain)
2008-02-01 13:39 UTC, R. David Murray
Details
small threading showcase (test2.py,947 bytes, text/plain)
2008-03-17 18:29 UTC, René 'Necoro' Neumann
Details
patch to make flickrfs work (made_it_work_01.patch,829 bytes, patch)
2008-03-26 22:22 UTC, René 'Necoro' Neumann
Details | Diff
fuse_python_accept_none.patch (fuse_python_accept_none.patch,1.97 KB, patch)
2008-04-07 23:37 UTC, René 'Necoro' Neumann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Glover (RETIRED) gentoo-dev 2007-06-30 05:47:41 UTC
Of all the applications I have written ebuilds for that depend on fuse-python, only flickrfs shows any semblance of working, and it has degraded functionality.

This leads me to believe that fuse-python is not working at all.

I am going to relate all the broken fuse-python stuff and then kick this bug out to the Tokyo Linux Users Group list, in hopes that one of the Pythonistas there-subscribed will have time and motivation to help me hack this out.

I don't know Python from a hole in the ground. :(
Comment 1 Josh Glover (RETIRED) gentoo-dev 2007-06-30 05:51:02 UTC
Created attachment 123448 [details]
fuse-python-0.2.ebuild

Ebuild for the full 0.2 version; only 0.2_pre2 is in Portage.

This changes nothing by itself, though. :(
Comment 2 Josh Glover (RETIRED) gentoo-dev 2007-07-02 01:38:11 UTC
Created attachment 123576 [details]
fuse-python-0.1.ebuild

Maybe everyone wants version 0.1
Comment 3 Josh Glover (RETIRED) gentoo-dev 2007-07-02 01:39:04 UTC
Created attachment 123577 [details, diff]
Fixes compile errors

Taken from http://bugs.gentoo.org/attachment.cgi?id=52578
Comment 4 Russell Harmon 2007-07-20 05:37:56 UTC
*** Bug 185944 has been marked as a duplicate of this bug. ***
Comment 5 Russell Harmon 2007-07-20 05:40:57 UTC
The new gmailfs-0.8.0 works (and requires) fuse-python-0.2. I haven't noticed
any reduced functionality.
Comment 6 R. David Murray 2008-02-01 13:35:02 UTC
Hi, I'm the new lead maintainer for the flickrfs package.  I'm also a
long time Gentoo user, though I haven't tried to make any contributions
before this.  I can confirm that (1) flickrfs works with fuse-python
0.1 (currently avaialble as the python-fuse ebuild, but not what the
flickrfs ebuild depends on) and that (2) it does not work correctly with
fuse-python 0.2.

The 0.2 problem involves threading.  Specifically, threads started in
the main flickrfs.py application freeze once fuse-python is called.
From the data I have gathered so far (which only consists of four data
points, unfortunately), this appears to be a gentoo specific problem
with fuse-python.  I and the one other gentoo user I have heard from
have the problem.  The one non-gentoo user (someone on Debian sid)
does not have the problem.  I contacted the fuse-python developer, and he
cannot reproduce the threading bug, even though he is using the exact
same fuse version, python version, and kernel version that I am.

Unfortunately, while I am an experienced python programmer, I am not
experienced with coding python extensions in C, and thus am not in much
of a position to debug this.  However, the fact that it is threading
related may lead to someone being able to suggest some experiments I
could try to try to isolate the problem.  For example, is there a way
for me to recompile some things (eg: Fuse and Python) with a different
threading package?

I can also supply a fuse-python test program that demonstrates the
threading problem.  It is a slight modification of the xmp.py demo
program that comes with fuse-python.  I will attach it.  If you run
it, it will print out 'ticking' four or five times, when it should,
if threading were working correctly, print it out ticking nine times
and then throw a NotImplementedError.

Let me know what I can do to help resolve this.
Comment 7 R. David Murray 2008-02-01 13:39:01 UTC
Created attachment 142372 [details]
Example demonstrating threading problem with fuse-python 0.2

To run:

  xmp.py --version /tmp somemountpoint

In failure mode it prints out 'ticking' four or five times and then stops (but continues to do the normal functions of xmp.py, which is to mirror /tmp to your chosen mount point in this case).  If threading were working correctly it would print out ticking ten times and then throw NotImplementedError in the thread.
Comment 8 Łukasz Damentko (RETIRED) gentoo-dev 2008-03-14 17:44:18 UTC
Reassigning since jmglov has retired from Gentoo.
Comment 9 René 'Necoro' Neumann 2008-03-17 17:51:42 UTC
If you use

import threading
print "starting thread"
threading.Thread(target=self.mythread).start()

instead of

import thread
print "starting thread"
thread.start_new_thread(self.mythread, ())

it works for me. So perhaps it is really an "error" in the underlying python thread implementation - which gets fixed in the threading module. But afaik there is no use in using thread instead of threading anyway.
Comment 10 René 'Necoro' Neumann 2008-03-17 18:29:22 UTC
Created attachment 146405 [details]
small threading showcase

I think, I found the reason it behaves like it behaves :)

Threads created with the "thread" module run in daemon mode - i.e. they are stopped as soon as the main program quits. I guess this is even true if the main program forks (I guess this is what fuse does).
Threads created with "threading" run in non-daemon (if not set to daemon mode explictly) - so they even run when the main program has stopped.

Thus I created the attached showcase. Run it w/o any arguments to get the "thread" module, with one argument to get "threading" and with two to get "threading as daemon". - And watch the output. This really seems like what we are seeing in the bug :)
Comment 11 René 'Necoro' Neumann 2008-03-22 09:24:51 UTC
Just found this while reading the fuse-dev m-l ...

http://www.nabble.com/Re:-thread-in-python-fuse-when-running-on-background--p15289550.html
Comment 12 René 'Necoro' Neumann 2008-03-26 22:20:52 UTC
Ok - I really found the issue: It's an error in the compat mode of fuse-python.
In getattr_compat_0_1 an instance of os.stat_result is returned, whereas (for what ever reasons) a fuse.Struct instance is wanted. Perhaps it is because of the additional members in os.stat_result.

However: I'll forward this upstream.
Comment 13 René 'Necoro' Neumann 2008-03-26 22:22:47 UTC
Created attachment 147413 [details, diff]
patch to make flickrfs work

And here is a patch, which makes the CVS version of flickrfs working with fuse-python-0.2 (note: no -pre :))

(And: This still uses the old API)
Comment 14 René 'Necoro' Neumann 2008-03-26 22:25:18 UTC
Just as a note - works with fuse-python-0.2_pre2 (the version in portage) too.
Comment 15 René 'Necoro' Neumann 2008-04-07 23:37:34 UTC
Created attachment 149060 [details, diff]
fuse_python_accept_none.patch

And here is now a patch which should resolve the issue - patching fuse-python itself. It no longer needs patches to the applications (like flickrfs).

If upstream responds in a positive way, we are near to a solution.
If upstream does not respond, I'll provide the ebuild _and_ the patch.
Comment 16 René 'Necoro' Neumann 2008-04-16 16:31:21 UTC
Are there any further comments from the flickrfs site? - If not: WORKSFORME
Comment 17 Markus Ullmann (RETIRED) gentoo-dev 2008-04-21 20:21:54 UTC
fuse-python in shape again now