Skip to content

Commit

Permalink
8300051: assert(JvmtiEnvBase::environments_might_exist()) failed: to …
Browse files Browse the repository at this point in the history
…enter event controller, JVM TI environments must exist

Reviewed-by: dholmes, pchilanomate
  • Loading branch information
Serguei Spitsyn committed Jul 20, 2023
1 parent 4e8f331 commit 783de32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
25 changes: 14 additions & 11 deletions src/hotspot/share/prims/jvmtiExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,6 @@ JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) {
return JNI_EVERSION; // unsupported major version number
}
}
if (Continuations::enabled()) {
// Virtual threads support. There is a performance impact when VTMS transitions are enabled.
if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) {
if (!JvmtiVTMSTransitionDisabler::VTMS_notify_jvmti_events()) {
ThreadInVMfromNative __tiv(JavaThread::current());
JvmtiEnvBase::enable_virtual_threads_notify_jvmti();
}
} else {
JvmtiVTMSTransitionDisabler::set_VTMS_notify_jvmti_events(true);
}
}

if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) {
JavaThread* current_thread = JavaThread::current();
Expand All @@ -399,12 +388,26 @@ JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) {

JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
*penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv*

if (Continuations::enabled()) {
// Virtual threads support for agents loaded into running VM.
// There is a performance impact when VTMS transitions are enabled.
if (!JvmtiVTMSTransitionDisabler::VTMS_notify_jvmti_events()) {
JvmtiEnvBase::enable_virtual_threads_notify_jvmti();
}
}
return JNI_OK;

} else if (JvmtiEnv::get_phase() == JVMTI_PHASE_ONLOAD) {
// not live, no thread to transition
JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
*penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv*

if (Continuations::enabled()) {
// Virtual threads support for agents loaded at startup.
// There is a performance impact when VTMS transitions are enabled.
JvmtiVTMSTransitionDisabler::set_VTMS_notify_jvmti_events(true);
}
return JNI_OK;

} else {
Expand Down
1 change: 0 additions & 1 deletion test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ serviceability/sa/TestRevPtrsForInvokeDynamic.java 8241235 generic-all

serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 windows-all
serviceability/jvmti/vthread/GetSetLocalTest/GetSetLocalTest.java 8286836 generic-all
serviceability/jvmti/vthread/VThreadTLSTest/VThreadTLSTest.java#id1 8300051 generic-all
serviceability/dcmd/gc/RunFinalizationTest.java 8227120 linux-all,windows-x64

serviceability/sa/ClhsdbCDSCore.java 8267433 macosx-x64
Expand Down

0 comments on commit 783de32

Please sign in to comment.