JDK-8314453 : serviceability/sa/ClhsdbCDSCore.java fails with "'Common-Cleaner' missing from stdout/stderr"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 22
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2023-08-16
  • Updated: 2024-06-28
  • Resolved: 2024-06-28
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
tbdResolved
Related Reports
Duplicate :  
Description
The test intentionally produces a core file (at what is suppose to be a point where the JVM is "stable"), and then does various clhsdb commands on the core file.

  printmdo -a
  printall
  jstack -v

The output is truncated because it is so large. Before truncation, the output of the "printmdo" command appears to be working, but after truncation you start to see the following exception which is indicative of being in the middle of a GC or class loading. Based on the CommandProcessor$20.doit() line number, this is happening during the "printall" command.

java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
	at java.base/java.util.Objects.checkIndex(Objects.java:365)
	at jdk.hotspot.agent/sun.jvm.hotspot.oops.ConstantPoolCache.getEntryAt(ConstantPoolCache.java:86)
	at jdk.hotspot.agent/sun.jvm.hotspot.interpreter.BytecodeWithCPIndex.indexForFieldOrMethod(BytecodeWithCPIndex.java:60)
	at jdk.hotspot.agent/sun.jvm.hotspot.interpreter.BytecodeGetPut.toString(BytecodeGetPut.java:58)
	at jdk.hotspot.agent/sun.jvm.hotspot.ui.classbrowser.HTMLGenerator$1.visit(HTMLGenerator.java:685)
	at jdk.hotspot.agent/sun.jvm.hotspot.interpreter.BytecodeDisassembler.decode(BytecodeDisassembler.java:156)
	at jdk.hotspot.agent/sun.jvm.hotspot.ui.classbrowser.HTMLGenerator.genHTML(HTMLGenerator.java:659)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$20$1.visit(CommandProcessor.java:967)
	at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderData.classesDo(ClassLoaderData.java:107)
	at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderDataGraph.classesDo(ClassLoaderDataGraph.java:84)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$20.doit(CommandProcessor.java:960)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2212)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2182)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:2053)
	at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:112)
	at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:44)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:281)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:500)

Then at the end, during the jstack, another indication that we may be in the middle of a GC because we cannot get from a hotspot JavaThread object to the Thread object to get the name of the Thread:

WARNING: could not get Thread object: sun.jvm.hotspot.debugger.UnmappedAddressException: 7eff013b8
Could not get the java Thread object. Thread info will be limited.

Because the Thread names are not printed, "Common-Cleaner" is not found in the output so the test complains and fails.

Comments
Closing as dup of JDK-8318754. Likely a dup of JDK-8284045 also. Core files on macosx-aarch64 are not reliable and can be missing some chunks of memory leading to SA getting various address errors when trying to read from valid addresses.
28-06-2024