RFR: 8361103: java_lang_Thread::async_get_stack_trace does not properly protect JavaThread [v6]
Alex Menkov
amenkov at openjdk.org
Tue Aug 5 22:34:47 UTC 2025
On Tue, 5 Aug 2025 05:22:33 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fix broken build
>
> src/hotspot/share/classfile/javaClasses.cpp line 1885:
>
>> 1883: }
>> 1884:
>> 1885: oop java_lang_Thread::async_get_stack_trace(jobject jthread, TRAPS) {
>
> Please add a comment describing how the method works for virtual threads, and what returning null implies.
Done.
> src/hotspot/share/classfile/javaClasses.cpp line 1939:
>
>> 1937: // Target thread has been unmounted.
>> 1938: return;
>> 1939: }
>
> Shouldn't we set `carrier = true` if we don't return here? Or am I misunderstanding what "carrier" means here?
"carrier" means target is a platform thread with mounted virtual thread.
When `carrier == true` `vframeStream` skips frames of the mounted virtual thread.
Here target is a virtual thread, so we need frames starting from the last frame
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26119#discussion_r2255469604
PR Review Comment: https://git.openjdk.org/jdk/pull/26119#discussion_r2255466533
More information about the hotspot-dev
mailing list