We've run into a bit of a problem with the JDWP implementation
in JDK 5.0. It would seem that this assumes (at least in debug
asserts) that events in general, and more specific, breakpoint
events reported through JVMTI, are reported through the same
thread that causes them.
The spec for JVMTI states that the breakpoint callback is called
like:
void JNICALL Breakpoint(jvmtiEnv *,JNIEnv*,jthread, jmethodID, location)
where the parameters are defined as:
JNIEnv * - The JNI environment of the event (current) thread
jthread - Thread that hit the breakpoint
jmethodID - Method that hit the breakpoint
jlocation - location of the breakpoint
Our intepretation of this is that the implementation is free to
report a breakpoint through a separate thread, and that the agent
should not assume to be run in the same thread as the breakpoint.
The assertion I ran into is located at
src/share/back/threadcontrol.c:1957
1956 /* JNIEnv should always be the same for a given thread */
1957 JDI_ASSERT(node->env == env);
I can't see any reason in the event handling code of JDWP that would
make this assumption neccesary, so I would very much appreciate a
resolution that just removed it.
in JDK 5.0. It would seem that this assumes (at least in debug
asserts) that events in general, and more specific, breakpoint
events reported through JVMTI, are reported through the same
thread that causes them.
The spec for JVMTI states that the breakpoint callback is called
like:
void JNICALL Breakpoint(jvmtiEnv *,JNIEnv*,jthread, jmethodID, location)
where the parameters are defined as:
JNIEnv * - The JNI environment of the event (current) thread
jthread - Thread that hit the breakpoint
jmethodID - Method that hit the breakpoint
jlocation - location of the breakpoint
Our intepretation of this is that the implementation is free to
report a breakpoint through a separate thread, and that the agent
should not assume to be run in the same thread as the breakpoint.
The assertion I ran into is located at
src/share/back/threadcontrol.c:1957
1956 /* JNIEnv should always be the same for a given thread */
1957 JDI_ASSERT(node->env == env);
I can't see any reason in the event handling code of JDWP that would
make this assumption neccesary, so I would very much appreciate a
resolution that just removed it.
- relates to
-
JDK-5098199 JDWP: Switch findThread() to use ThreadLocalStorage
-
- Resolved
-