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

JDWP: cbEarlyException in JDWP.dll leaks JVMTI allocated memory

    XMLWordPrintable

Details

    • 5.0
    • b57
    • other
    • generic

    Description

      FULL JDK VERSION(S)
      Sun Java 5.0 - from inspection of code only
      IBM Java 5.0 build from stress test run
      DESCRIPTION:
      Implementation of cbEarlyException in debugInit.c includes the fragment
          error = classSignature(clazz, &signature, NULL);
          if ( (error==JVMTI_ERROR_NONE) &&
              (strcmp(signature, initOnException) == 0)) {
              LOG_MISC(("Initializing on specific exception"));
              initialize(env, thread, EI_EXCEPTION);
              jvmtiDeallocate(signature);
          } else {
              error = JVMTI_ERROR_INTERNAL; /* Just to cause restore */
          }
      The classSignature funtion causes JVMTI to allocate memory for a class signature. However, the
      jvmtiDeallocate call to release it is only run if it was allocated successfully AND the signature
      matches the initOnException string. If the signature does NOT match the initOnException string,
      it is never freed.
      This is easy to verify on an IBM build, using IBM trace. Without this you could put a printf in
      jvmtiDeallocate and classSignature (both in util.c) and run the command:
      java -Xint -Xrunjdwp:transport=dt_socket,server=y,onhrow=foo.bar,launch=echo NoSuchClass <- non-existent class
      You will see allocations without matching frees.
      [This bug is being submitted as a courtesy, in order to maintain uniformity between Sun & IBM JDKs. It has been fixed in IBM JDKs.
      Please contact ###@###.### if you have questions.]

      Attachments

        Activity

          People

            ohair Kelly Ohair (Inactive)
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: