RFR: 8293339: vm/jvmti/StopThread/stop001/stop00103 crashes with SIGSEGV in Continuation::is_continuation_mounted

Serguei Spitsyn sspitsyn at openjdk.org
Mon Sep 12 21:57:01 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;

Chris and Leonid, thank you for review!

-------------

PR: https://git.openjdk.org/jdk/pull/10235


More information about the hotspot-dev mailing list