8220352: Crash with assert(external_guard || result != __null) failed: Invalid JNI handle
Summary: Don't delete globalrefs that might still be referenced
Reviewed-by: gadams, jcbeyler, sspitsyn
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MonitorWait/monitorwait001/monitorwait001.cpp Wed Mar 13 21:01:56 2019 +0100
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MonitorWait/monitorwait001/monitorwait001.cpp Wed Mar 13 19:42:23 2019 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -147,10 +147,6 @@
jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
nsk_jvmti_setFailStatus();
- /* dispose global references */
- jni->DeleteGlobalRef(object);
- jni->DeleteGlobalRef(thread);
-
return NSK_TRUE;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MonitorWaited/monitorwaited001/monitorwaited001.cpp Wed Mar 13 21:01:56 2019 +0100
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MonitorWaited/monitorwaited001/monitorwaited001.cpp Wed Mar 13 19:42:23 2019 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -148,10 +148,6 @@
jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
nsk_jvmti_setFailStatus();
- /* dispose global references */
- jni->DeleteGlobalRef(object);
- jni->DeleteGlobalRef(thread);
-
return NSK_TRUE;
}