JDK-8310860 : gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java failed with "jmap -heap exited with error code: 1"
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 22
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2023-06-25
  • Updated: 2024-07-22
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
tbdUnresolved
Related Reports
Relates :  
Sub Tasks
JDK-8330130 :  
Description
The following test failed in the JDK22 CI:

gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java

Here's a snippet from the log file:

#section:main
----------messages:(11/456)----------
command: main gc.metaspace.CompressedClassSpaceSizeInJmapHeap
reason: User specified action: run main/timeout=240 gc.metaspace.CompressedClassSpaceSizeInJmapHeap 
started: Sun Jun 25 05:39:45 GMT 2023
Mode: agentvm
Agent id: 19
Additional exports to unnamed modules from @modules: java.base/jdk.internal.misc
Timeout refired 960 times
Timeout information:
--- Timeout information end.
finished: Sun Jun 25 06:03:03 GMT 2023
elapsed time (seconds): 1397.27
----------configuration:(15/2038)----------

<snip>

----------System.out:(6/1606)----------
Could not confirm if TargetJDK is hardened. Assuming not hardened.
Command line: ['/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-22+3-168/macosx-x64-open.jdk/jdk-22.jdk/Contents/Home/bin/java' '-XX:MaxRAMPercentage=4.16667' '-Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/20/36/bundles/macos-x64/jdk-20_macos-x64_bin.tar.gz/jdk-20.jdk/Contents/Home' '-Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S50821/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/67c4e1ed-fa3e-41be-98c4-cb385d64a2e6/runs/0666cc48-8a71-4598-bc17-8abda64afd52/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_gc/tmp' '-XX:CompressedClassSpaceSize=48m' '-cp' '/System/Volumes/Data/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S50821/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/67c4e1ed-fa3e-41be-98c4-cb385d64a2e6/runs/0666cc48-8a71-4598-bc17-8abda64afd52/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_gc/classes/5/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.d:/System/Volumes/Data/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S50821/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/67c4e1ed-fa3e-41be-98c4-cb385d64a2e6/runs/0666cc48-8a71-4598-bc17-8abda64afd52/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_gc/classes/5/test/lib' 'jdk.test.lib.apps.LingeredApp' '1f4b3cbd-b14f-4a73-ae88-630d2c6d6749.lck']
LingeredApp startup took 1198ms
Check for hs_err_pid/core/mdmp files:
None.
Adding 'sudo -E -n' to the command.
----------System.err:(11/679)----------
java.lang.Exception: jmap -heap exited with error code: 1
	at gc.metaspace.CompressedClassSpaceSizeInJmapHeap.run(CompressedClassSpaceSizeInJmapHeap.java:84)
	at gc.metaspace.CompressedClassSpaceSizeInJmapHeap.main(CompressedClassSpaceSizeInJmapHeap.java:70)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1570)

JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test

result: Error. Agent error: java.lang.Exception: Agent 19 timed out with a timeout of 960 seconds; check console log for any additional details
Comments
This test recently passed in a different run of the same tier8 task. It was skipped in this run, as it should always be when running on hardened OSX system: ----------System.out:(12/608)---------- STDOUT: Executable=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-22+4-215/macosx-x64-open.jdk/jdk-22.jdk/Contents/Home/bin/java STDOUT: Identifier=net.java.openjdk-ea.java STDOUT: Format=Mach-O thin (x86_64) STDOUT: CodeDirectory v=20500 size=644 flags=0x10000(runtime) hashes=9+7 location=embedded Target JDK is hardened. Some tests may be skipped. STDOUT: Signature size=9010 STDOUT: Timestamp=Jun 23, 2023 at 11:27:59 PM STDOUT: Info.plist entries=5 STDOUT: TeamIdentifier=VB5E2TV963 STDOUT: Runtime Version=11.1.0 STDOUT: Sealed Resources=none STDOUT: Internal requirements count=1 size=184 ----------System.err:(11/669)---------- jtreg.SkippedException: SA Attach not expected to work. JDK is hardened. at jdk.test.lib.SA.SATestUtils.skipIfCannotAttach(SATestUtils.java:67) at gc.metaspace.CompressedClassSpaceSizeInJmapHeap.main(CompressedClassSpaceSizeInJmapHeap.java:51) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333) at java.base/java.lang.Thread.run(Thread.java:1570) However, in this failed test case, it is not being skipped, and we are not seeing the expected output from running codesign: ----------System.out:(6/1606)---------- Could not confirm if TargetJDK is hardened. Assuming not hardened. Command line: ['/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-22+3-168/macosx-x64-open.jdk/jdk-22.jdk/Contents/Home/bin/java' '-XX:MaxRAMPercentage=4.16667' '-Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/20/36/bundles/macos-x64/jdk-20_macos-x64_bin.tar.gz/jdk-20.jdk/Contents/Home' '-Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S50821/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/67c4e1ed-fa3e-41be-98c4-cb385d64a2e6/runs/0666cc48-8a71-4598-bc17-8abda64afd52/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_gc/tmp' '-XX:CompressedClassSpaceSize=48m' '-cp' '/System/Volumes/Data/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S50821/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/67c4e1ed-fa3e-41be-98c4-cb385d64a2e6/runs/0666cc48-8a71-4598-bc17-8abda64afd52/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_gc/classes/5/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.d:/System/Volumes/Data/mesos/work_dir/slaves/cd627e65-f015-4fb1-a1d2-b6c9b8127f98-S50821/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/67c4e1ed-fa3e-41be-98c4-cb385d64a2e6/runs/0666cc48-8a71-4598-bc17-8abda64afd52/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_gc/classes/5/test/lib' 'jdk.test.lib.apps.LingeredApp' '1f4b3cbd-b14f-4a73-ae88-630d2c6d6749.lck'] LingeredApp startup took 1198ms Check for hs_err_pid/core/mdmp files: None. Adding 'sudo -E -n' to the command. ----------System.err:(11/679)---------- java.lang.Exception: jmap -heap exited with error code: 1 at gc.metaspace.CompressedClassSpaceSizeInJmapHeap.run(CompressedClassSpaceSizeInJmapHeap.java:84) at gc.metaspace.CompressedClassSpaceSizeInJmapHeap.main(CompressedClassSpaceSizeInJmapHeap.java:70) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333) at java.base/java.lang.Thread.run(Thread.java:1570) I think something went wrong when running codesign, but it's hard to say what went wrong since there is no output. Note that isHardenedOSX() does not check the codesign process exit code. It just spawns the process and tries to read the output. Possibly codesign simply failed to run for some reason.
26-06-2023