RFR: JDK-8310584: GetThreadState reports blocked and runnable for pinned suspended virtual threads
Serguei Spitsyn
sspitsyn at openjdk.org
Fri Jul 14 03:58:13 UTC 2023
On Thu, 13 Jul 2023 19:18:38 GMT, Alex Menkov <amenkov at openjdk.org> wrote:
> The change fixes handling of "suspended" bit in VT state.
> The code looks very strange.
> java_lang_VirtualThread::RUNNING == 3, so line 803 clears JVMTI_THREAD_STATE_ALIVE(1) and JVMTI_THREAD_STATE_TERMINATED(2)
> Per log this code came from loom repo with VT integration.
>
> Testing: tier1-4, updated GetThreadStateMountedTest.java
@alexmenkov Do you consider backporting this to 21?
src/hotspot/share/prims/jvmtiEnvBase.cpp line 804:
> 802: if (ext_suspended && ((state & JVMTI_THREAD_STATE_ALIVE) != 0)) {
> 803: state |= JVMTI_THREAD_STATE_SUSPENDED;
> 804: }
One question unrelated to this bug and your fix.
I wonder if any check and handling is needed for the case:
`if (ext_suspended && ((state & JVMTI_THREAD_STATE_ALIVE) == 0))`
Not sure this condition is even possible. But do we need to add an assert here?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14878#issuecomment-1635229248
PR Review Comment: https://git.openjdk.org/jdk/pull/14878#discussion_r1263261620
More information about the serviceability-dev
mailing list