Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8153673

[BACKOUT] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command

    Details

    • Subcomponent:
    • Resolved In Build:
      b115
    • CPU:
      generic
    • OS:
      generic

      Backports

        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.

          Issue Links

            Activity

            Hide
            dcubed Daniel Daugherty added a comment -
            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
            Show
            dcubed Daniel Daugherty added a comment - 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
            Hide
            dcubed Daniel Daugherty added a comment - - edited
            The second stabilization change is this one:

            JDK-8153671 Quarantine serviceability/tmtools/jstack/JstackThreadTest.java until JDK-8153319 is fixed
            Show
            dcubed Daniel Daugherty added a comment - - edited The second stabilization change is this one: JDK-8153671 Quarantine serviceability/tmtools/jstack/JstackThreadTest.java until JDK-8153319 is fixed
            Hide
            dcubed Daniel Daugherty added a comment - - edited
            The third stabilization change is this one:

            JDK-8153668 Quarantine closed/jdk/management/resource/ThrottledMeterTest.java until JDK-8153395 is fixed
            Show
            dcubed Daniel Daugherty added a comment - - edited The third stabilization change is this one: JDK-8153668 Quarantine closed/jdk/management/resource/ThrottledMeterTest.java until JDK-8153395 is fixed
            Hide
            dcubed Daniel Daugherty added a comment -
            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>
            Show
            dcubed Daniel Daugherty added a comment - 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>
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/hs-rt/jdk/rev/a16240806984
            User: dcubed
            Date: 2016-04-07 00:54:34 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs-rt/jdk/rev/a16240806984 User: dcubed Date: 2016-04-07 00:54:34 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/a16240806984
            User: lana
            Date: 2016-04-20 17:52:51 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/a16240806984 User: lana Date: 2016-04-20 17:52:51 +0000

              People

              • Assignee:
                dcubed Daniel Daugherty
                Reporter:
                dcubed Daniel Daugherty
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: