RFR: JDK-8310584: GetThreadState reports blocked and runnable for pinned suspended virtual threads

Alex Menkov amenkov at openjdk.org
Fri Jul 14 18:34:12 UTC 2023


On Fri, 14 Jul 2023 03:54:42 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

> @alexmenkov Do you consider backporting this to 21?

maybe it makes sense.

> 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?

AFAIU it's possible in the case when we have terminated VT and JvmtiVTSuspender is requested to suspend all virtual threads

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

PR Comment: https://git.openjdk.org/jdk/pull/14878#issuecomment-1636234168
PR Review Comment: https://git.openjdk.org/jdk/pull/14878#discussion_r1264027796


More information about the serviceability-dev mailing list