RFR: 8266593: vmTestbase/nsk/jvmti/PopFrame/popframe011 fails with "assert(java_thread == _state->get_thread()) failed: Must be" [v3]

Serguei Spitsyn sspitsyn at openjdk.java.net
Fri Nov 19 10:11:39 UTC 2021


On Thu, 18 Nov 2021 17:15:06 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   get rid of the checks in jvmti handshakes: java_thread->threadObj() == NULL
>
> src/hotspot/share/prims/jvmtiEnvBase.cpp line 1533:
> 
>> 1531:     return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
>> 1532:   }
>> 1533:   assert(java_thread == _state->get_thread(), "Must be");
> 
> This `assert()` is the site of the original test failure. I haven't yet
> looked at the locations of the other changes.
> 
> The `is_exiting()` check is made under the protection of the
> `JvmtiThreadState_lock` so an unsuspended target thread that is
> exiting cannot reach the point where the `_state` is updated to
> clear the `JavaThread*` so we can't fail the `assert()` if the
> `is_exiting()` check has returned `false`.

Dan,
Thank you for reviewing this!
I'm not sure, I correctly understand you here.
Are you saying that you agree with this change?
In fact, the thread state can not be changed (and the assert fired) after the `is_exiting()` check is made even without `JvmtiThreadState_lock` protection because it is inside of a handshake execution.

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

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


More information about the serviceability-dev mailing list