RFR: 8297170: misc JCK tests fail with "FATAL ERROR in native method: JDWP Can't disable vthread end events, jvmtiError=JVMTI_ERROR_WRONG_PHASE(112)"

Alex Menkov amenkov at openjdk.org
Wed Nov 23 02:53:33 UTC 2022


On Wed, 23 Nov 2022 02:22:46 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> [JDK-8295376](https://bugs.openjdk.org/browse/JDK-8295376) introduced some new code that disables JVMTI VIRTUAL_THREAD_START/END events when the debugger disconnects. Sometimes this disabling attempt results in a JVMTI_ERROR_WRONG_PHASE. The reason is because often the disconnect and debuggee exit are happening at the same time. By the time the disable is attempted, the VM has already sent (and the debug agent processed) the VM_DEATH event, so the VM is now in JVMTI_PHASE_DEAD.
> 
> To fix this I took the direct approach of just allowing JVMTI_ERROR_WRONG_PHASE if VM_DEATH has been sent already. I could have tried something more elegant that would have synchronized on the vmDeathLock, and avoided the disabling call completely, but I didn't think the risk of a deadlock was worth it, so I kept it simple.

Marked as reviewed by amenkov (Reviewer).

-------------

PR: https://git.openjdk.org/jdk/pull/11307


More information about the serviceability-dev mailing list