-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
6
-
generic
-
generic
When a native thread attaches to the VM through JNI_AttachCurrentThread it needs a java.lang.Thread object to be constructed for it. However to construct a Thread object requires execution of Java code, and to execute Java code an attached thread must have a Thread object and appear as a fully fledged java.lang.Thread, and VM JavaThread and appear in the threads_list etc. This catch-22 is currently addressed by attaching the native thread to a raw unconstructed Thread object, setting some essential values whilst in native code, and then calling into the VM to execute the Thread constructor to complete the initialization of the Thread object. This means that while executing the constructor the associated Thread object contains default initialized values (ie zero or null) for things like its name and ID. Because the Thread is visible to the system (eg jvmti and mmx code) at this stage it is possible for these zero values to trigger exceptions or even (in the past) VM crashes.
We need to find a way to fully create the Thread object without exposing it with unitinitalized values.
We need to find a way to fully create the Thread object without exposing it with unitinitalized values.
- relates to
-
JDK-6404306 IllegalArgumentException:Invalid thread ID occurs in 6.0b76
- Closed
-
JDK-6576701 Thread.getName does not handle null name
- Closed
-
JDK-6771287 JVM sometimes exits before all non-daemon threads quit
- Open
-
JDK-8287982 Concurrent implicit attach from native threads crashes VM
- Closed
-
JDK-6300358 JVM abort with Full thread dump by kill -QUIT
- Closed