RFR: 8361103: java_lang_Thread::async_get_stack_trace does not properly protect JavaThread [v7]

David Holmes dholmes at openjdk.org
Wed Aug 6 05:41:10 UTC 2025


On Tue, 5 Aug 2025 22:34:46 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

>> The fix updates `java_lang_Thread::async_get_stack_trace()` (used by `java.lang.Thread.getStackTrace()` to get stack trace for platform and mounted virtual threads) to correctly use `ThreadListHandle` for thread protection.
>> 
>> Testing: tier1..5
>
> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   comment to async_get_stack_trace

Looks good (a couple of typos). Thanks.

src/hotspot/share/classfile/javaClasses.cpp line 1887:

> 1885: // Obtain stack trace for platform or mounted virtual thread.
> 1886: // If jthread is a virtual thread and it has been unmounted (or remounted to different carrier) the method returns null.
> 1887: // The caller (java.lang.VirtulThread) handles retuned nulls via retry.

Suggestion:

// The caller (java.lang.VirtualThread) handles returned nulls via retry.

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26119#pullrequestreview-3090401802
PR Review Comment: https://git.openjdk.org/jdk/pull/26119#discussion_r2255852479


More information about the hotspot-dev mailing list