Skip to content

Commit 672f566

Browse files
committed
8254874: ZGC: JNIHandleBlock verification failure in stack watermark processing
Reviewed-by: tschatzl, cjplummer, sspitsyn, pliden
1 parent 98a395a commit 672f566

File tree

1 file changed

+5
-0
lines changed
  • test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001

1 file changed

+5
-0
lines changed

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/cm03t001.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
339339
if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
340340
return NSK_FALSE;
341341

342+
/* klass is used by other threads - convert to global handle */
343+
if (!NSK_JNI_VERIFY(jni, (klass = (jclass)jni->NewGlobalRef(klass)) != NULL))
344+
return NSK_FALSE;
345+
342346
/* get tested thread method 'delay' */
343347
if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "delay", "()V")) != NULL))
344348
return NSK_FALSE;
@@ -811,6 +815,7 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
811815
nsk_jvmti_setFailStatus();
812816

813817
NSK_TRACE(jni->DeleteGlobalRef(thread));
818+
NSK_TRACE(jni->DeleteGlobalRef(klass));
814819

815820
/* resume debugee and wait for sync */
816821
if (!nsk_jvmti_resumeSync())

0 commit comments

Comments
 (0)