On Wed, 17 Nov 2021 22:21:33 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:

> The test fails when the target JavaThread has is_exiting() status. In such a 
> case the JvmtiExport::cleanup_thread(this) has already made a clean up of its 
> jvmtiThreadState, so the JavaThread address returned by _state->get_thread() 
> is 0xbabababababababa.
> The fix is to add a check for is_exiting() status into handshake closure 
> do_thread() early.
> There following handshake closures are fixed by this update:
>   - UpdateForPopTopFrameClosure
>  - SetForceEarlyReturn
>  - SetFramePopClosure

Hi Leonid,

Something seems amiss to me.

First the checks for `java_thread->threadObj() == NULL` should not be necessary 
as the `threadObj` can never be NULL once it has been started and a non-started 
thread should not be possible by the time you reach the code doing the checks. 
Even if we nulled out `threadObj` for a terminated thread the `is_exiting` 
check would already handle that case.

Second, if the target thread is exiting then surely the suspension check should 
return false and so we would already give a JVMTI_ERROR_THREAD_NOT_SUSPENDED 
error?

Thanks,
David

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

PR: https://git.openjdk.java.net/jdk/pull/6440

Reply via email to