Integrated: 8293339: vm/jvmti/StopThread/stop001/stop00103 crashes with SIGSEGV in Continuation::is_continuation_mounted
Serguei Spitsyn
sspitsyn at openjdk.org
Mon Sep 12 21:59:31 UTC 2022
On Sat, 10 Sep 2022 00:05:22 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:
> I was not able to reproduce this issue in thousands of mach5 runs on multiple platforms. However, the root cause seems to be pretty simple. A JvmtiVTMSTransitionDisabler needs to be added to make the JVM TI StopThread function to be VTMS (Virtual Thread Mount state) transition safe.
>
> So the fix is a one-liner:
>
> diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp
> index a9efe01c92e..f5e9176230a 100644
> --- a/src/hotspot/share/prims/jvmtiEnv.cpp
> +++ b/src/hotspot/share/prims/jvmtiEnv.cpp
> @@ -1182,6 +1182,8 @@ JvmtiEnv::ResumeAllVirtualThreads(jint except_count, const jthread* except_list)
> jvmtiError
> JvmtiEnv::StopThread(jthread thread, jobject exception) {
> JavaThread* current_thread = JavaThread::current();
> +
> + JvmtiVTMSTransitionDisabler disabler;
> ThreadsListHandle tlh(current_thread);
> JavaThread* java_thread = NULL;
> oop thread_oop = NULL;
This pull request has now been integrated.
Changeset: d3f7e3b4
Author: Serguei Spitsyn <sspitsyn at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/d3f7e3b41779427a0765bdd40a3627cb0490cbce
Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod
8293339: vm/jvmti/StopThread/stop001/stop00103 crashes with SIGSEGV in Continuation::is_continuation_mounted
Reviewed-by: cjplummer, lmesnik
-------------
PR: https://git.openjdk.org/jdk/pull/10235
More information about the serviceability-dev
mailing list