On Fri, 3 Nov 2023 20:09:28 GMT, Alex Menkov <[email protected]> wrote:
>> It is a fix of a minor test issue.
>> The test should not fail when the JVMTI function
>> `SetEventNotificationMode()` returns errors codes:
>> - `JVMTI_ERROR_THREAD_NOT_ALIVE`
>> - `JVMTI_ERROR_WRONG_PHASE`
>>
>> Tested the fix locally and with mach5 test runs.
>
> test/hotspot/jtreg/serviceability/jvmti/stress/StackTrace/Suspended/libGetStackTraceSuspendedStress.cpp
> line 125:
>
>> 123: err = jvmti->SetEventNotificationMode(JVMTI_ENABLE,
>> JVMTI_EVENT_SINGLE_STEP, vthread);
>> 124: if (err == JVMTI_ERROR_THREAD_NOT_ALIVE ||
>> 125: err == JVMTI_ERROR_WRONG_PHASE) {
>
> WRONG_PHASE looks good to me, but why THREAD_NOT_ALIVE is considered expected
> for suspended thread?
> if the thread was terminated, SuspendThread should return THREAD_NOT_ALIVE,
> but once SuspendThread returns ERROR_NONE, how the thread can terminates
> before ResumeThread?
My question exactly. I'm not even sure why wrong phase is allowed here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16488#discussion_r1382799696