On Mon, 6 Nov 2023 06:16:20 GMT, Alan Bateman <al...@openjdk.org> wrote:

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

Thank you for the comments.
Alex, you are right.
I've misread this code at line 201:

199         err = jvmti->SuspendThread(vthread);
200         if (err == JVMTI_ERROR_THREAD_NOT_ALIVE) {
201           continue;
202         }
203         check_jvmti_status(jni, err, "Error in SuspendThread");
204         // LOG("Agent: suspended vt: %s ct: %s\n", vname, cname);
205 
206         check_vthread_consistency_suspended(jvmti, jni, vthread);

The function `check_vthread_consistency_suspended()` is not called when if the 
`SuspendThread` returned `JVMTI_ERROR_THREAD_NOT_ALIVE` error code.

It does not look as a test bug then.

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

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

Reply via email to