I'm seeing a jfr internal error printing the result of a JFR collection with OpenJ9 JDK 21:
jfr print foo4.jfr
jfr print: unexpected internal error, Range [1, -1) out of bounds for length 6
java.lang.StringIndexOutOfBoundsException: Range [1, -1) out of bounds for length 6
at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55)
at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112)
at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349)
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:5640)
at java.base/java.lang.String.substring(String.java:3599)
at jdk.jfr/jdk.jfr.internal.tool.PrettyWriter.formatMethod(PrettyWriter.java:465)
at jdk.jfr/jdk.jfr.internal.tool.PrettyWriter.printJavaFrame(PrettyWriter.java:449)
at jdk.jfr/jdk.jfr.internal.tool.PrettyWriter.printValue(PrettyWriter.java:311)
at jdk.jfr/jdk.jfr.internal.tool.PrettyWriter.printStackTrace(PrettyWriter.java:247)
at jdk.jfr/jdk.jfr.internal.tool.PrettyWriter.print(PrettyWriter.java:225)
at jdk.jfr/jdk.jfr.internal.tool.PrettyWriter.print(PrettyWriter.java:75)
at jdk.jfr/jdk.jfr.internal.tool.EventPrintWriter.print(EventPrintWriter.java:82)
at jdk.jfr/jdk.jfr.internal.tool.Print.execute(Print.java:165)
at jdk.jfr/jdk.jfr.internal.tool.Main.main(Main.java:92)
This fails with a 0.57 JDK 21 build on x86-64, as well as latest Semeru nightly build on JDK 21.
BusyWorkTest.java
openjdk version "21.0.11-beta" 2026-04-21
IBM Semeru Runtime Open Edition 21.0.11+7-202603211948 (build 21.0.11-beta+7-202603211948)
Eclipse OpenJ9 VM 21.0.11+7-202603211948 (build 21.0.11-beta+7-202603211948-master-5354e076b7, JRE 21 Linux amd64-64-Bit Compressed References 20260321_754 (JIT enabled, AOT enabled)
OpenJ9 - 5354e076b7
OMR - db4e13717
JCL - 02a7b880f based on jdk-21.0.11+7)
OpenJDK does not have this problem, nor does OpenJ9 jfr have a problem with printing OpenJDK-collected data. However, OpenJDK fails with the same error on OpenJ9-collected data. Both facts lead me to suspect the problem is on the OpenJ9 collection side.
I've seen this on a couple of different applications, but I've attached an IBM Bob-generated test (BusyWorkTest.java) just for this purpose that shows the problem. To reproduce:
java -XX:+FlightRecorder BusyWorkTest
and at the 30 second mark, issue the following:
jcmd <vmid> JFR.start filename=foo.jfr duration=60s
and then attempt to print it with:
I'm seeing a
jfrinternal error printing the result of a JFR collection with OpenJ9 JDK 21:This fails with a 0.57 JDK 21 build on x86-64, as well as latest Semeru nightly build on JDK 21.
BusyWorkTest.java
OpenJDK does not have this problem, nor does OpenJ9
jfrhave a problem with printing OpenJDK-collected data. However, OpenJDK fails with the same error on OpenJ9-collected data. Both facts lead me to suspect the problem is on the OpenJ9 collection side.I've seen this on a couple of different applications, but I've attached an IBM Bob-generated test (BusyWorkTest.java) just for this purpose that shows the problem. To reproduce:
and at the 30 second mark, issue the following:
and then attempt to print it with: