JDK-8339288 : Improve diagnostic logging runtime/cds/DeterministicDump.java
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-08-29
  • Updated: 2024-11-19
  • Resolved: 2024-11-13
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 b24Fixed
Description
Currently, diagnosing the failures in DeterministicDump.java rely on analysis of the CDS map files, which are saved in the scratch directory when this test is executed.

Normally, we run jtreg with at least -retain:fail, so the CDS map files are saved when the test fails. However, when this test fails inside GitHub actions, the map files are not saved. We only see a very short error message:

STDERR:
java.lang.RuntimeException: File content different at byte #4, b0 = 96, b1 = 80
at DeterministicDump.compare(DeterministicDump.java:114)
at DeterministicDump.doTest(DeterministicDump.java:73)
at DeterministicDump.main(DeterministicDump.java:42)

But this is just the archive checksum, which is useless for diagnostic purposes.

Instead, we should print the textual diff of the first material difference between the two map files. For example: if the 5th word of this method is different in the two dumps (0000000000000000 vs 1111111111111111), we print out the following to STDOUT, to be captured in the JTR file.

[first difference: map file #1]
0x00000008001b8ef8:   0000000000000000 0000000000000000 0000000000000000 0000000000000000   ................................
0x00000008001b8f18: @@ Method            128 java.lang.Object java.lang.Object.clone()
0x00000008001b8f18:   00000008000007c0 0000000000000000 0000000800dcb4f8 0000000000000000   ................................
0x00000008001b8f38:   0000000000000000 0000000000000000 0000000400000104 0300000300000000   ................................
0x00000008001b8f58:   0000000000000000 0000000800585710 0000000000000000 0000000000000000   .........WX.....................
0x00000008001b8f78:   0000000000000000 0000000000000000 0000000000000000 0000000000000000   ................................

[first difference: map file #2]
0x00000008001b8ef8:   0000000000000000 0000000000000000 0000000000000000 0000000000000000   ................................
0x00000008001b8f18: @@ Method            128 java.lang.Object java.lang.Object.clone()
0x00000008001b8f18:   00000008000007c0 0000000000000000 0000000800dcb4f8 0000000000000000   ................................
0x00000008001b8f38:   1111111111111111 0000000000000000 0000000400000104 0300000300000000   ................................
0x00000008001b8f58:   0000000000000000 0000000800585710 0000000000000000 0000000000000000   .........WX.....................
0x00000008001b8f78:   0000000000000000 0000000000000000 0000000000000000 0000000000000000   ................................





Comments
Changeset: 3b283543 Branch: master Author: Matias Saavedra Silva <matsaave@openjdk.org> Date: 2024-11-13 23:18:31 +0000 URL: https://git.openjdk.org/jdk/commit/3b283543c33df8c225e10b9186b7bc3cefd1a347
13-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21913 Date: 2024-11-05 18:36:01 +0000
05-11-2024