RFR: 8362083: JDI VirtualMachine/dispose/dispose001 failed with FATAL ERROR in native method: JDWP cannot set thread local storage, jvmtiError=JVMTI_ERROR_WRONG_PHASE(112)
Serguei Spitsyn
sspitsyn at openjdk.org
Thu Dec 4 22:03:34 UTC 2025
On Thu, 4 Dec 2025 05:14:51 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
>> src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c line 173:
>>
>>> 171: }
>>> 172: }
>>> 173: if (error == JVMTI_ERROR_WRONG_PHASE && gdata->vmDead && isVThread(thread)) {
>>
>> Shouldn't be check for any daemon threads and not only virtual?
>
> It's only possible to end up in this situation with vthreads. That's because when the debugger disconnects, we free all the ThreadNodes for vthreads. We don't do that for platform threads or non-java threads. threadControl_reset() is calling removeVThreads() when this issue turns up. There is no equivalent for other thread types.
Should `JVMTI_ERROR_THREAD_NOT_ALIVE` be added to this check for better reliability?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28653#discussion_r2590723369
More information about the serviceability-dev
mailing list