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

test hprof lib: invalid array element type from JavaValueArray.elementSize

XMLWordPrintable

    • svc
    • b18
    • generic
    • generic

        test hprof parser lib throw exception calculating length of the primitive values array (HPROF_GC_PRIM_ARRAY_DUMP subrecord).
        The simplest way to reproduce the issue is to call JavaValueArray.valueString method (called by JavaObject.toString() for String objects).

        java.lang.RuntimeException: invalid array element type: 66
        at jdk.test.lib.hprof.model.JavaValueArray.elementSize(JavaValueArray.java:82)
        at jdk.test.lib.hprof.model.JavaValueArray.readValueLength(JavaValueArray.java:102)
        at jdk.test.lib.hprof.model.JavaLazyReadObject.getValueLength(JavaLazyReadObject.java:68)
        at jdk.test.lib.hprof.model.JavaValueArray.getLength(JavaValueArray.java:252)
        at jdk.test.lib.hprof.model.JavaValueArray.readValue(JavaValueArray.java:112)
        at jdk.test.lib.hprof.model.JavaLazyReadObject.getValue(JavaLazyReadObject.java:79)
        at jdk.test.lib.hprof.model.JavaValueArray.valueString(JavaValueArray.java:280)
        at jdk.test.lib.hprof.model.JavaValueArray.valueString(JavaValueArray.java:274)
        at jdk.test.lib.hprof.model.JavaObject.toString(JavaObject.java:193)

        Another issue is JavaObject.toString() method for String objects tries to construct string value of the object from "value" field assuming "value" field is array of char. Actually it's byte array.

              amenkov Alex Menkov
              amenkov Alex Menkov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: