JDK-8314993 : [lworld] Add support for runtime/cds/CDSMapTest.java
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-08-25
  • Updated: 2024-07-17
  • Resolved: 2024-07-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
Related Reports
Relates :  
Description
Valhalla gives the following error, since the test was introduced during merge of jdk-22+8

java.lang.RuntimeException: CDS map file seems incorrect: 24359 objects but only 3100 oop field references
	at CDSMapTest.dump(CDSMapTest.java:82)
	at CDSMapTest.doTest(CDSMapTest.java:62)
	at CDSMapTest.main(CDSMapTest.java:42)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:582)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
	at java.base/java.lang.Thread.run(Thread.java:1570)
Comments
A pull request was submitted for review. Branch: lworld URL: https://git.openjdk.org/valhalla/pull/1170 Date: 2024-07-16 16:23:34 +0000
16-07-2024

The failure is caused by the extra newline in the output. This newline is probably added in fieldDescriptor::print_on_for() in the valhalla repo. See this in archiveBuilder.cpp: if (ArchiveHeapWriter::is_marked_as_native_pointer(_heap_info, _source_obj, fd->offset())) { print_as_native_pointer(fd); } else { fd->print_on_for(_st, _source_obj); // name, offset, value <<<<<< HERE _st->cr(); } Even though the test case could have been changed to be more intelligent in parsing the map file, the valhalla repo should revert the newline change in print_on_for to be consistent with JDK mainline. 0x0000000010000000: @@ Object java.lang.String - klass: 'java/lang/String' 0x0000000800011d28 - fields (4 words): - private 'hash' 'I' @12 0 (0x00000000) - private final 'coder' 'B' @16 0 (0x00) - private 'hashIsZero' 'Z' @17 true (0x01) - injected 'flags' 'B' @18 1 (0x01) - private final 'value' '[B' @24 0x0000000010000020 [B length: 0
30-08-2023