RFR: 8361103: java_lang_Thread::async_get_stack_trace does not properly protect JavaThread [v3]
Alan Bateman
alanb at openjdk.org
Wed Jul 9 05:33:41 UTC 2025
On Tue, 8 Jul 2025 18:44:43 GMT, Alex Menkov <amenkov at openjdk.org> wrote:
> I suppose the comment is obsolete. I don't see `executeOnCarrierThread` in the current codebase. The condition checks if there were some changes in vthread/carrier: `ce == nullptr` - the carries has no mounted vthread now (i.e. the vthread has been unmounted); `ce->cont_oop(thread) != java_lang_VirtualThread::continuation(_java_thread())` - the carrier has other vthread mounted; Even if there were unmount/mount the same vthread on the carrier, it's fine (we need vthread stack trace and we are in handshake with its carrier)
I suspect it dates back to when there were temporary transitions and where the thread identity had to be temporarily changed to the carrier thread. We've been able to remove that complexity, which eliminates complexity from JVMTI, and maybe here too.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26119#issuecomment-3051177617
More information about the hotspot-dev
mailing list