From 4e3ff29a54a78aab9ee67cb13fb4bf6868c41699 Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Mon, 26 Jan 2026 17:41:15 -0800 Subject: [PATCH] 8373367: interp-only mechanism fails to work for carrier threads in a corner case --- src/hotspot/share/prims/jvmtiThreadState.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/prims/jvmtiThreadState.cpp b/src/hotspot/share/prims/jvmtiThreadState.cpp index fc965e568f7..d292fe9a645 100644 --- a/src/hotspot/share/prims/jvmtiThreadState.cpp +++ b/src/hotspot/share/prims/jvmtiThreadState.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,6 +124,10 @@ JvmtiThreadState::JvmtiThreadState(JavaThread* thread, oop thread_oop) } thread->set_interp_only_mode(false); } + if (JvmtiEnvBase::is_thread_carrying_vthread(thread, thread_oop)) { + _thread_saved = thread; + _thread = nullptr; + } }