"GCJ 4.0 bug workarround" causes crash in high concurreny
Brought to you by:
plevart
When compiled with sun javac and run with HotSpot 1.5.0, when filesystem is accessed simultaneously by large number of processes (~50) an occasional JVM crash will occur on SIGSEGV.
When JVM is run with "-Xcheck:jni", the following error message shows:
FATAL ERROR in native method: Using JNIEnv in non-Java thread
Commenting out lines 213-214 in javafs.c (see attached patch) fixes this problem.
Fixing patch
Do you think that that is a JVM bug?
Is it also worth logging a bug against the JVM?
The bug may be in the JVM, but I can't say I fully understand where the crash is. The proposed fix undoes a previous change that, in some JVMs, avoids doing AttachCurrentThreadAsDaemon. I believe the fact that the thread was not joined causes the crash.