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

invoking method through JDWP with byte[] argument may crash backend

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • vm-legacy
    • x86
    • windows_nt



      Name: tb29552 Date: 02/16/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)


      invoking a method through JDWP (cmd: JDWP_ClassType_InvokeMethod) with an array
      of a primitive type (such as byte[]) as a method argument results in a back-end
      crash.

      this is caused by a bug in the function nextArgumentTypeTag (invoker.c):

      ////////////// begin original code
      static jbyte
      nextArgumentTypeTag(void **cursor)
      {
          char *tagPtr = *cursor;
          jbyte argumentTag = (jbyte)*tagPtr;

          if (*tagPtr != SIGNATURE_END_ARGS) {
              /* Skip any class name or additional array modifiers */
              if ((*tagPtr == JDWP_Tag_ARRAY) ||
                  (*tagPtr == JDWP_Tag_OBJECT)) {
                  tagPtr = strchr(tagPtr, SIGNATURE_END_CLASS);
                  JDI_ASSERT(tagPtr);
              }
              tagPtr++;
          }

          *cursor = tagPtr;
          return argumentTag;
      }
      ////////////// end original code

      ////////////// begin fixed code
      static jbyte
      nextArgumentTypeTag(void **cursor)
      {
          char *tagPtr = *cursor;
          jbyte argumentTag = (jbyte)*tagPtr;

          while (*tagPtr != SIGNATURE_END_ARGS) {
              /* Skip any class name or additional array modifiers */
              if (*tagPtr == JDWP_Tag_ARRAY) {
                  tagPtr++;
                  continue;
              }
              if (*tagPtr == JDWP_Tag_OBJECT) {
                  tagPtr = strchr(tagPtr, SIGNATURE_END_CLASS);
                  JDI_ASSERT(tagPtr);
              }
              tagPtr++;
              break;
          }

          *cursor = tagPtr;
          return argumentTag;
      }
      ////////////// end fixed code
      (Review ID: 117123)
      ======================================================================

            rfield Robert Field (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: