Re: FUSE-J: get_env() problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: FUSE-J: get_env() problem

Peter Levart
On Saturday 21 May 2005 16:51, Alexander Boström wrote:
> FUSE-J would segfault as soon as it had mounted the file system and gdb
> showed that get_env() was returning garbage (0x1). I assumed that the
> problem was that get_env() and thus AttachCurrentThreadAsDaemon() was
> being called multiple times before release_env(). Since
> AttachCurrentThreadAsDaemon() is a no-op if the thread is already
> attached it wouldn't always set the env pointer.

If this is what GCJ does then this is a bug in GCJ. The JNI spec says:

"If the thread has already been attached via either AttachCurrentThread or
AttachCurrentThreadAsDaemon, this routine simply sets the value pointed to by
penv to the JNIEnv of the current thread. In this case neither
AttachCurrentThread nor this routine have any effect on the daemon status of
the thread."

>
> I applied the attached patch and the problem went away. It makes
> get_env() call GetEnv() first before trying to attach. Is this the
> correct solution?

This is correct workarround for GCJ bug. I will include it in next release of
FUSE-J. Thanks for the patch.

Does it otherwise work with GCJ? I haven't realy tried this yet.

Peter


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
<a href="http://ads.osdn.com/?ad_idt12&alloc_id344&op=click">http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: FUSE-J: get_env() problem

Alexander Boström-4
mån 2005-05-23 klockan 09:45 +0200 skrev Peter Levart:

> If this is what GCJ does then this is a bug in GCJ.

Ok, I'll file a bug report in the appropriate place.

> This is correct workarround for GCJ bug. I will include it in next release of
> FUSE-J. Thanks for the patch.

Thanks!

> Does it otherwise work with GCJ? I haven't realy tried this yet.

I didn't notice any other problems. The ZipFilesystem works.

/abo




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
<a href="http://ads.osdn.com/?ad_idt12&alloc_id344&op=click">http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel