JDK-8272400 : [lworld] serviceability/sa/CDSJMapClstats.java fails: No suitable match for type of address
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-08-13
  • Updated: 2021-08-17
  • Resolved: 2021-08-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-valhallaFixed
Description
This happens with the fix in JDK-8272290, plus the patch https://bugs.openjdk.java.net/secure/attachment/95973/refval-v1.patch

--- ProcessLog ---
cmd: /home/iklam/jdk/bld/fastdebug/images/jdk/bin/jhsdb -J-XX:MaxRAMPercentage=3.142 -J-XX:InitialRAMPercentage=0.5 jmap --clstats --pid 17792
exitvalue: 1
stderr: finding class loader instances ..done.
computing per loader stat ..sun.jvm.hotspot.types.WrongTypeException: No suitable match for type of address 0x0000000800120000
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.InstanceConstructor.newWrongTypeException(InstanceConstructor.java:62)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:111)
	at jdk.hotspot.agent/sun.jvm.hotspot.oops.Metadata.instantiateWrapperFor(Metadata.java:76)
	at jdk.hotspot.agent/sun.jvm.hotspot.oops.MetadataField.getValue(MetadataField.java:43)
	at jdk.hotspot.agent/sun.jvm.hotspot.oops.MetadataField.getValue(MetadataField.java:40)
	at jdk.hotspot.agent/sun.jvm.hotspot.oops.Klass.getNextLinkKlass(Klass.java:125)
	at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderData.classesDo(ClassLoaderData.java:101)
	at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderDataGraph.classesDo(ClassLoaderDataGraph.java:84)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.ClassLoaderStats.printClassLoaderStatistics(ClassLoaderStats.java:111)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.ClassLoaderStats.run(ClassLoaderStats.java:78)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:121)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:278)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:241)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:134)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:202)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:340)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:500)

stdout: Attaching to process ID 17792, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 18-internal+0-adhoc.iklam.open


Comments
Fix: diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java index 79961fd261b..c2cb42994ce 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java @@ -113,7 +113,7 @@ public class FileMapInfo { } private static void populateMetadataTypeArray(TypeDataBase db) { - metadataTypeArray = new Type[8]; + metadataTypeArray = new Type[10]; metadataTypeArray[0] = db.lookupType("ConstantPool"); metadataTypeArray[1] = db.lookupType("InstanceKlass"); @@ -123,6 +123,8 @@ public class FileMapInfo { metadataTypeArray[5] = db.lookupType("Method"); metadataTypeArray[6] = db.lookupType("ObjArrayKlass"); metadataTypeArray[7] = db.lookupType("TypeArrayKlass"); + metadataTypeArray[8] = db.lookupType("FlatArrayKlass"); + metadataTypeArray[9] = db.lookupType("InlineKlass"); } public FileMapHeader getHeader() { ==================== But we also need to implement the following classes in SA: sun/jvm/hotspot/oops/FlatArrayKlass.java sun/jvm/hotspot/oops/InlineKlass.java
13-08-2021

Dumping with -Xlog:cds+map=debug shows: 0x0000000800120000: @@ Class 1128 java.util.Optional This class has been changed in the patch -public final class OptionalDouble { +public final primitive class OptionalDouble.val { The SA/CDS interface needs to be updated to handle primitive classes.
13-08-2021