Details
-
Bug
-
Resolution: Fixed
-
P3
-
11, 17, 21
-
b24
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8311858 | 17.0.9-oracle | Tobias Hartmann | P3 | Resolved | Fixed | b02 |
JDK-8312000 | 17.0.9 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 |
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.
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
- backported by
-
JDK-8311858 Error in parsing replay file when staticfield is an array of single dimension
- Resolved
-
JDK-8312000 Error in parsing replay file when staticfield is an array of single dimension
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/3006096e
-
Commit openjdk/jdk/d3feedf5
-
Review openjdk/jdk17u-dev/1569
-
Review openjdk/jdk/14024
(1 links to)