JDK-8344821 : Test CheckDefaultArchiveFile.java fails if classes_coh.jsa is not present
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-11-22
  • Updated: 2024-11-28
  • Resolved: 2024-11-26
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.
JDK 24
24 b26Fixed
Related Reports
Relates :  
Description
java.lang.RuntimeException: Java HotSpot(TM) 64-Bit Server VM(amd64)has no c:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk-24+25-3117\\windows-x64-debug.jdk\\jdk-24\\fastdebug\\bin\\server\\classes_coh.jsa
	at CheckDefaultArchiveFile.main(CheckDefaultArchiveFile.java:62)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1447)

The builds involved do not generate the classes_coh.jsa file, but CDSConfig still sets the default archive path to classes_coh.jsa if UseCOH is enabled.

I'm not sure if the bug is in the test or CDSConfig - the latter seems to assume the classes_coh.jsa must exist which is not the case.
Comments
Changeset: 24655267 Branch: master Author: Calvin Cheung <ccheung@openjdk.org> Date: 2024-11-26 17:17:45 +0000 URL: https://git.openjdk.org/jdk/commit/246552674c5508ba350836389a0fa35716e776fb
26-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22374 Date: 2024-11-25 23:45:55 +0000
25-11-2024

I think the test is no longer valid and should be deleted. There's no way to tell if "a default CDS archive should exist for a $JAVA_HOME". This is a build time decision whose only effect is whether a given classes??.jsa exists in $JAVA_HOME or not. The original summary "JDK platforms/binaries do not support default CDS archive should not contain classes.jsa in the default location" seems vacuous: "a file that does not exist should not exist", so there's really nothing to test for.
24-11-2024

After the fix for JDK-8341533, by default, JDK built within Oracle will not generate the compact object headers CDS archive (classes*_coh.jsa). I think in the test in the case that the expected CDS archive doesn't exist, it should check if the UseCompactObjectHeaders is enabled and the expected CDS archive file name ends with "_coh.jsa", just throws a SkippedException.
23-11-2024