diff --git a/test/hotspot/jtreg/serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/libTestAllocatingInVMDeath.cpp b/test/hotspot/jtreg/serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/libTestAllocatingInVMDeath.cpp index 5f46d69afa1..93d66bc38bc 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/libTestAllocatingInVMDeath.cpp +++ b/test/hotspot/jtreg/serviceability/jvmti/events/VMDeath/AllocatingInVMDeath/libTestAllocatingInVMDeath.cpp @@ -37,6 +37,10 @@ cbVMDeath(jvmtiEnv* jvmti, JNIEnv* jni) { fatal(jni, "Can't find upCall method."); } jni->CallStaticObjectMethod(clz, mid); + if (jni->ExceptionOccurred()) { + jni->ExceptionDescribe(); + fatal(jni, "cbVMDeath: unexpected exception occurred in Java upcall method."); + } } JNIEXPORT jint JNICALL