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

Error in parsing replay file when staticfield is an array of single dimension

    XMLWordPrintable

Details

    • b24

    Backports

      Description

        If the replay file contains an entry for a static field of array type, then the parsing logic fails.
        For instance, consider a replay file with following entry at line 675:

        ---
        675: staticfield ArrayTest objs [LArrayTest$SomeClass; 10 [LArrayTest$SomeClass;
        ---

        When the replay file is used using "java -XX:+UnlockDiagnosticVMOptions -XX:+ReplayCompiles -XX:ReplayDataFile=<replay file>", JVM spits out following error message:

        ---
        Error while parsing line 675 at position 53: line not properly terminated

        Failed on line not properly terminated
        ---

        Looks like while parsing the staticfield in CompileReplay::process_staticfield() if the field is single dimensional array, the parser does not consume the class name after the array length in the following block of code:

                } else if (field_signature[0] == JVM_SIGNATURE_ARRAY &&
                           field_signature[1] == JVM_SIGNATURE_CLASS) {
                  Klass* kelem = resolve_klass(field_signature + 1, CHECK);
                  value = oopFactory::new_objArray(kelem, length, CHECK);
                }


        This can be fixed by calling parse_klass() to eat up the class name, but ignore its result.

        Attachments

          Issue Links

            Activity

              People

                asmehra Ashutosh Mehra
                asmehra Ashutosh Mehra
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: