8300051: assert(JvmtiEnvBase::environments_might_exist()) failed: to enter event controller, JVM TI environments must exist

Reviewed-by: cjplummer
Backport-of: 783de32b6a
This commit is contained in:
Serguei Spitsyn
2023-07-25 00:11:16 +00:00
committed by Vitaly Provodin
parent 6517cc564e
commit c72add02ac
2 changed files with 14 additions and 12 deletions

View File

@@ -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();
@@ -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 {

View File

@@ -119,7 +119,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 8294316,8267433 macosx-x64