On Tue, 28 Apr 2026 20:03:51 GMT, Patricio Chilano Mateo 
<[email protected]> wrote:

>> Please review the following small fix. When trying to get the snapshot of a 
>> platform thread, we can find the `JavaThread` in the created 
>> `ThreadsListHandle`, but before executing the 
>> `GetThreadSnapshotHandshakeClosure` the target might have already set its 
>> `_terminated` field to `_thread_terminated`. In that case the 
>> `Handshake::execute` call will return without the closure being executed. 
>> Since `cl._thread_status` is initialized to `JavaThreadStatus::NEW` we hit 
>> the next assert in the code.
>> 
>> The proposed fix is to initialize `cl._thread_status` to 
>> `JavaThreadStatus::TERMINATED` instead.
>> 
>> I added new test `ThreadExiting.java` which reliably reproduces the issue.
>> 
>> Thanks,
>> Patricio
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Patricio Chilano Mateo has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   keep default state as NEW

Okay nothing further from me.

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/30903#pullrequestreview-4193927125

Reply via email to