RFR: 8361103: java_lang_Thread::async_get_stack_trace does not properly protect JavaThread [v4]
Daniel D. Daugherty
dcubed at openjdk.org
Thu Jul 10 23:37:40 UTC 2025
On Thu, 10 Jul 2025 21:36:53 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:
>
> carrier in TLH
src/hotspot/share/runtime/threadSMR.cpp line 797:
> 795: // return JavaThread for the carrier thread; if the thread is unmounted
> 796: // or use_carrier is false, return false.
> 797: //
Right after the check on L827 below, what prevents the vthread from being unmounted?
So we fetch the JavaThread* on L833 and then verify that it is protected by the TLH
which is good, but that does not prevent the vthread from being unmounted by the
time that we return the JavaThread* on L853 below.
Am I missing something?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26119#discussion_r2198998536
More information about the hotspot-dev
mailing list