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 ................................