On Mon, 6 Nov 2023 05:34:04 GMT, David Holmes <dhol...@openjdk.org> wrote:

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

Is the issue here that agent thread started by Debuggee.checkStatus is racing 
with the test? The producer/consumer thread do 1000 put/take ops and it looks 
like it can complete and VM commence shutdown while the agent thread is 
observing, do I read this correctly?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16488#discussion_r1382823031

Reply via email to