JDK-8153673 : [BACKOUT] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8u102,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-04-06
  • Updated: 2020-09-01
  • Resolved: 2016-04-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u102Fixed 9 b115Fixed openjdk7uFixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
This is a placeholder for making changes to stabilize the 2016.04.05 JDK9-hs-rt
snapshot. More details and links to follow.

Update: changed the summary from "stabilize 2016.04.05 JDK9-hs-rt snapshot"
to "[BACKOUT] JDWP: Memory Leak: GlobalRefs never deleted when processing
invokeMethod command" since there are now other bugs to do the quarantine work.

Comments
Sanity checks for backing out this fix and its test: $ hg log -r 277d7584fa03 changeset: 13880:277d7584fa03 parent: 13877:645a9be6eddb user: sgehwolf date: Mon Mar 21 11:24:09 2016 +0100 summary: 4858370: JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command $ hg status M src/jdk.jdwp.agent/share/native/libjdwp/invoker.c R test/com/sun/jdi/OomDebugTest.java ? files.list $ hg diff -r 13877 `cat files.list ` <empty output> $ hg diff src/jdk.jdwp.agent/share/native/libjdwp/invoker.c diff -r 96b1cfa80016 src/jdk.jdwp.agent/share/native/libjdwp/invoker.c --- a/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c Sat Apr 02 05:30:48 2016 +0200 +++ b/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c Wed Apr 06 14:57:33 2016 -0700 @@ -209,47 +209,6 @@ createGlobalRefs(JNIEnv *env, InvokeRequ } return error; -} - -/* - * Delete global references from the request which got put there before a - * invoke request was carried out. See fillInvokeRequest() and invoker invoke*() - * impls. - */ -static void -deleteGlobalRefs(JNIEnv *env, InvokeRequest *request) -{ - void *cursor; - jint argIndex = 0; - jvalue *argument = request->arguments; - jbyte argumentTag = firstArgumentTypeTag(request->methodSignature, &cursor); - - if (request->clazz != NULL) { - tossGlobalRef(env, &(request->clazz)); - } - if (request->instance != NULL) { - tossGlobalRef(env, &(request->instance)); - } - /* Delete global argument references */ - while (argIndex < request->argumentCount) { - if ((argumentTag == JDWP_TAG(OBJECT)) || - (argumentTag == JDWP_TAG(ARRAY))) { - if (argument->l != NULL) { - tossGlobalRef(env, &(argument->l)); - } - } - argument++; - argIndex++; - argumentTag = nextArgumentTypeTag(&cursor); - } - /* Delete potentially saved return values */ - if ((request->invokeType == INVOKE_CONSTRUCTOR) || - (returnTypeTag(request->methodSignature) == JDWP_TAG(OBJECT)) || - (returnTypeTag(request->methodSignature) == JDWP_TAG(ARRAY))) { - if (request->returnValue.l != NULL) { - tossGlobalRef(env, &(request->returnValue.l)); - } - } } static jvmtiError @@ -777,13 +736,6 @@ invoker_completeInvokeRequest(jthread th (void)outStream_writeObjectRef(env, &out, exc); outStream_sendReply(&out); } - - /* - * At this time, there's no need to retain global references on - * arguments since the reply is processed. No one will deal with - * this request ID anymore, so we must call deleteGlobalRefs(). - */ - deleteGlobalRefs(env, request); } jboolean $ hg diff -r 13877 src/jdk.jdwp.agent/share/native/libjdwp/invoker.c <empty output>
06-04-2016

The third stabilization change is this one: JDK-8153668 Quarantine closed/jdk/management/resource/ThrottledMeterTest.java until JDK-8153395 is fixed
06-04-2016

The second stabilization change is this one: JDK-8153671 Quarantine serviceability/tmtools/jstack/JstackThreadTest.java until JDK-8153319 is fixed
06-04-2016

Jesper and Serguei, First stabilization I'm looking at is backing out this fix: JDK-4858370 JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command That will backout this test: com/sun/jdi/OomDebugTest.java which will resolve this integration_blocker: JDK-8152686 com/sun/jdi/OomDebugTest.java fails with java.lang.reflect.InvocationTargetException Backing out JDK-4858370 may also resolve this integration_blocker: JDK-8152985 nsk/jdi tests fail with unexpected com.sun.jdi.InvocationException
06-04-2016