eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 721 forks source link

Jdmpview from Java 22 does not work for system core files from Java 17. #19934

Closed manqingl closed 2 months ago

manqingl commented 3 months ago

It looks to me some generated classes were deleted from openj9.dtfj.jmod. This breaks the backward compatibility of Jdmpview

/common/public/tools/ddr/x/jdk-20.1+8/bin/java -Xshareclasses:none -version openjdk version "22.0.1-beta" 2024-04-16 IBM Semeru Runtime Open Edition 22.0.1+8-202406280047 (build 22.0.1-beta+8-202406280047) Eclipse OpenJ9 VM 22.0.1+8-202406280047 (build master-22eaa4d435, JRE 22 Linux amd64-64-Bit Compressed References 20240628_193 (JIT enabled, AOT enabled) OpenJ9 - 22eaa4d435 OMR - 47a9d248d JCL - e29be76fa based on jdk-22.0.1+8)

/common/public/tools/ddr/x/jdk-22.0.1+8/bin/jdmpview -J-Xshareclasses:none -core core.20240726.063619.30790.0001.dmp DTFJView version 4.29.5, using DTFJ version 1.12.29003 Loading image from DTFJ...

Warning: native libraries are not available for core.20240726.063619.30790.0001.dmp For a list of commands, type "help"; for how to use "help", type "help help" Available contexts (* = currently selected context) :

Source : file:///ecurep/sf/TS016/603/TS016603209/2024-07-26/core.20240726.063619.30790.0001.dmp.zip_unpack/scratch/core/core.20240726.063619.30790.0001.dmp *0 : PID: 56618 : JRE 17 Linux amd64-64 (build 17.0.9+9) IBM Semeru Runtime Open Edition

!stackslots 0x0096b300 Error executing DDR command !stackslots 0x0096b300 : null java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118) at java.base/java.lang.reflect.Method.invoke(Method.java:586) at openj9.dtfjview/com.ibm.jvm.dtfjview.CombinedContext.executeDDRInteractiveCommand(CombinedContext.java:258) at openj9.dtfjview/com.ibm.jvm.dtfjview.CombinedContext.execute(CombinedContext.java:169) at openj9.dtfjview/com.ibm.jvm.dtfjview.Session.execute(Session.java:813) at openj9.dtfjview/com.ibm.jvm.dtfjview.Session.execute(Session.java:767) at openj9.dtfjview/com.ibm.jvm.dtfjview.tools.ToolsRegistry.executeJdmpviewCommand(ToolsRegistry.java:183) at openj9.dtfjview/com.ibm.jvm.dtfjview.tools.ToolsRegistry.execute(ToolsRegistry.java:107) at openj9.dtfjview/com.ibm.jvm.dtfjview.tools.ToolsRegistry.execute(ToolsRegistry.java:88) at openj9.dtfjview/com.ibm.jvm.dtfjview.tools.ToolsRegistry.recordAndExecute(ToolsRegistry.java:72) at openj9.dtfjview/com.ibm.jvm.dtfjview.Session.runInteractive(Session.java:741) at openj9.dtfjview/com.ibm.jvm.dtfjview.Session.run(Session.java:665) at openj9.dtfjview/com.ibm.jvm.dtfjview.DTFJView.launch(DTFJView.java:52) at openj9.dtfjview/com.ibm.jvm.dtfjview.DTFJView.main(DTFJView.java:46) Caused by: java.lang.NoClassDefFoundError: com.ibm.j9ddr.vm29.pointer.generated.J9JITGPRSpillAreaPointer at com.ibm.j9ddr.vm29.j9.stackwalker.StackWalker$1.allAlgorithms(StackWalker.java:131) at com.ibm.j9ddr.vm29.j9.AlgorithmPicker.pickAlgorithm(AlgorithmPicker.java:43) at com.ibm.j9ddr.vm29.j9.stackwalker.StackWalker.getImpl(StackWalker.java:138) at com.ibm.j9ddr.vm29.j9.stackwalker.StackWalker.walkStackFrames(StackWalker.java:99) at com.ibm.j9ddr.vm29.tools.ddrinteractive.commands.StackWalkCommand.run(StackWalkCommand.java:144) at openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive.Context.tryCommand(Context.java:229) at openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive.Context.execute(Context.java:202) at openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive.DDRInteractive.execute(DDRInteractive.java:356) at openj9.dtfj/com.ibm.j9ddr.command.CommandReader.processLine(CommandReader.java:78) at openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive.DDRInteractive.processLine(DDRInteractive.java:331) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ... 13 more Caused by: java.lang.ClassNotFoundException: J9JITGPRSpillAreaPointer is not in core file at openj9.dtfj/com.ibm.j9ddr.StructureReader.getPointerClassBytes(StructureReader.java:1127) at openj9.dtfj/com.ibm.j9ddr.J9DDRClassLoader.getPointerClass(J9DDRClassLoader.java:227) at openj9.dtfj/com.ibm.j9ddr.J9DDRClassLoader.findClass(J9DDRClassLoader.java:129) at openj9.dtfj/com.ibm.j9ddr.J9DDRClassLoader.loadClass(J9DDRClassLoader.java:206) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1102) ... 24 more

manqingl commented 3 months ago

@pshipton @keithc-ca FYI

keithc-ca commented 3 months ago

I can confirm that J9JITGPRSpillArea is not in j9ddr.dat in 17.0.9+9. However, I don't see any references to that class either. Were you using any DDR plugins?

manqingl commented 3 months ago

I used the jdmpview tool in the !stackslots command (!stackslots 0x0096b300). The text in the top of this page has the details. @keithc-ca

keithc-ca commented 3 months ago

So no DDR plugins?

manqingl commented 3 months ago

No DDR plugins (assuming !stackslots is counted as a DDR command, but not as a DDR plugin).

gacholio commented 3 months ago

J9JITGPRSpillArea was added here: https://github.com/eclipse-openj9/openj9/commit/af13691598dd79b54f63f0affc8200c6e690bd38

I believe I added the structure (Jack committed it along with more changes). Did I miss something? There's no direct reference to the structure in the DDR code.

keithc-ca commented 3 months ago

There is an inlined instance in J9VMContinuation which is referenced in DDR code, but as far as I can tell, only in support of !continuationstack and !continuationstackslots which have guards that the core is from jdk19 or newer (which should not apply to the situation discussed here).

manqingl commented 2 months ago

Looks like the exception happens when a new instance of StackWalker_29_V0() is created at StackWalker.java:131 :

java.lang.ClassNotFoundException: J9JITGPRSpillAreaPointer is not in core file at openj9.dtfj/com.ibm.j9ddr.StructureReader.getPointerClassBytes(StructureReader.java:1133) at openj9.dtfj/com.ibm.j9ddr.J9DDRClassLoader.getPointerClass(J9DDRClassLoader.java:229) at openj9.dtfj/com.ibm.j9ddr.J9DDRClassLoader.findClass(J9DDRClassLoader.java:129) at openj9.dtfj/com.ibm.j9ddr.J9DDRClassLoader.loadClass(J9DDRClassLoader.java:206) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1075) at com.ibm.j9ddr.vm29.j9.stackwalker.StackWalker$1.allAlgorithms(StackWalker.java:131) at com.ibm.j9ddr.vm29.j9.AlgorithmPicker.pickAlgorithm(AlgorithmPicker.java:43) at com.ibm.j9ddr.vm29.j9.stackwalker.StackWalker.getImpl(StackWalker.java:138) at com.ibm.j9ddr.vm29.j9.stackwalker.StackWalker.walkStackFrames(StackWalker.java:99) at com.ibm.j9ddr.vm29.tools.ddrinteractive.commands.StackWalkCommand.run(StackWalkCommand.java:144) at openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive.Context.tryCommand(Context.java:229) at openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive.Context.execute(Context.java:202) at openj9.dtfj/com.ibm.j9ddr.tools.ddrinteractive.DDRInteractive.execute(DDRInteractive.java:356)

keithc-ca commented 2 months ago

I think this is a consequence of #18014. I'm hoping that this can be remedied by declaring a fictitious (and unused) field of J9JITGPRSpillArea which will allow that structure to be referenced. If I put a test build together, could you test it on a troublesome system dump, @manqingl? If so, which platform works for you?

manqingl commented 2 months ago

I can test in a Linux or AIX platform. @keithc-ca