dtrott / fuse4j Goto Github PK
View Code? Open in Web Editor NEWRe-factor of Fuse-J to support Mac OS X and fork into the background.
Home Page: http://sourceforge.net/projects/fuse-j
Re-factor of Fuse-J to support Mac OS X and fork into the background.
Home Page: http://sourceforge.net/projects/fuse-j
when running mount_fake_java.sh and tryong to 'ls' in the mounted dir,
i get the follwing errormessage:
"ls: fake: Device not configured"
looks like in FuseMount.java around line 56:
log.info("Mounting filesystem");
mount(args, fuseFS, threadGroup);
log.info("Filesystem is unmounted");
the first log is visible but the second never reached.
looks like the native mount functions hangs
INFO main fuse.FakeFilesystem-entering
INFO main fuse.FakeFilesystem-created
INFO main fuse.FuseMount-Mounting filesystem
DEBUG main fuse.FakeFilesystem-init: start filesystem
INFO main fuse.FakeFilesystem-Initializing Filesystem
DEBUG main fuse.FakeFilesystem- returning with success
DEBUG Thread-1 fuse.FakeFilesystem-statfs
DEBUG Thread-1 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=2044693401 ]
DEBUG Thread-2 fuse.FakeFilesystem-statfs
DEBUG Thread-2 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=855703640 ]
DEBUG Thread-1 fuse.FakeFilesystem-statfs
DEBUG Thread-1 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=113093521 ]
DEBUG Thread-2 fuse.FakeFilesystem-statfs
DEBUG Thread-2 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=239779852 ]
DEBUG Thread-1 fuse.FakeFilesystem-statfs
DEBUG Thread-1 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=1300650792 ]
DEBUG Thread-1 fuse.FakeFilesystem-statfs
DEBUG Thread-1 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=801818331 ]
DEBUG Thread-2 fuse.FakeFilesystem-statfs
DEBUG Thread-1 fuse.FakeFilesystem-statfs
DEBUG Thread-2 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=700804192 ]
DEBUG Thread-3 fuse.FakeFilesystem-statfs
DEBUG Thread-3 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=243323391 ]
DEBUG Thread-1 fuse.FakeFilesystem- returning: fuse.FuseStatfs[ blockSize=512, blocks=1000, blocksFree=200, blocksAvail=180, files=6, filesFree=0, namelen=1024, hashCode=1615734796 ]
DEBUG Thread-2 fuse.FakeFilesystem-getattr: path=/
DEBUG Thread-2 fuse.FakeFilesystem- returning: fuse.FuseGetattr[ mode=40755(OCT), inode=2066473405, nlink=1, uid=0, gid=0, rdev=0, size=3072, blocks=6, atime=1288701384, mtime=1288701384, ctime=1288701384, hashCode=2112978551 ]
DEBUG Thread-3 fuse.FakeFilesystem-statfs
environment (reported by maven)
Apache Maven 2.2.1
Java version: 1.6.0_20
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
OS name: "mac os x" version: "10.6.4" arch: "x86_64" Family: "mac"
The root cause of the issue is that the init() and destroy() methods are called from different threads as a result the main thread is still attached and the VM won't shut down.
Line 740, in javafs_setxattr, 3 local variables are defined twice, in different scopes. Result is that the cleanup logic will never be run, thus leaking memory. I think this has been present going way back.
I mount two file systems (Filesystem3) inside a unit test.
When I unmount the first file system:
Runtime.getRuntime().exec(new String[] { "bash", "-c", "umount " + mountPointOfFirstFs) });
I get a segfault:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000015e23acec, pid=18758, tid=35075
#
# JRE version: 7.0_15-b03
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.7-b01 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libjavafs.jnilib+0xfcec] get_env+0x2c
....
....
This seems to be because of the code in native_impl.c
after it returns from the fuse_main
loop inside the function Java_fuse_FuseMount_mount
. The function cleans up the threadgroup, fuseFS and associated classes from the java env.
If I edit native_impl.c
so that I return immediately after the fuse_main
function finishes I can avoid the segfault, and unmount both FileSystems. I assume, however, that this creates a memory leak.
(Note: I am assuming that was the suggested method for unmounting, judging by the other github issue #5)
Hi,
I am working on a Ramdisk implementation using fuse4j. So far almost everything works quite nicely.
listing xattributes in terminal via ls -l@ shows some weird behaviour. Find below a printout of the console part :
-rw-r--r--@ 1 tobiashaag staff 346 29 Mar 16:44 sdfgsdfg.rtf
com.apple.quarantine 23
-CDEF000000 -1
if i run ls -l@ again this is the result :
-rw-r--r--@ 1 tobiashaag staff 346 29 Mar 16:44 sdfgsdfg.rtf
com.apple.quarantine 23
-1
-1
seems some arbitrary memory locations are read, i.e the buffer for the attribute name in the listxattr() method seems to be the culprit.
Let me know if its just an implementation issue on my end or whether another fix is needed.
Thanks and great work !
Tobi
Hello,
how do you unmount programatically a mounted filesystem (like FuseMount.unmount... ) ?
I would very much like to add fuse's ioctl callback to fuse4j, but am not sure how to proceed. I see that some C files are autogenerated from Java class definitions, so I think I would add an ioctl method to FuseFS.java and run the CAPIGenerator ??
Anyone else any experience of adding methods to fuse-j?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.