JDK-8334598 : Default classlist in JDK is not deterministic after JDK-8293980
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-06-20
  • Updated: 2024-08-05
  • Resolved: 2024-06-25
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 b04Fixed
Related Reports
Relates :  
Description
The classlist generation during the JDK build is non deterministic. This makes the build not reproducible. We have observed two different outputs from what should be equivalent builds. See log from compare.sh:

./lib/classlist (diff size 965)
SHOW DIFF (first 500 lines): C:/sb/prod/171877~1/WORKSP~1/build/WINDOW~1/COMPAR~1/jdk/./lib/classlist.diff
--- /cygdrive/c/sb/prod/1718778423/workspace/build/windows-x64-cmp-baseline/images/jdk/./lib/classlist 2024-06-19 06:46:53.038604600 +0000
+++ /cygdrive/c/sb/prod/1718778423/workspace/build/compare-build/windows-x64-cmp-baseline/images/jdk/./lib/classlist 2024-06-19 07:11:15.822427300 +0000
@@ -1915,7 +1915,7 @@
@cp java/util/Arrays$ArrayList 2 8 15 16 53
@cp java/util/Arrays$LegacyMergeSort 7 15 20 27 41
@cp java/util/BitSet 1 3 7 11 22 24 183 287 292
-@cp java/util/Calendar 1 4 16 25 30 34 37 41 44 48 52 55 99 102 123 171 183 194 200 204 207 210 256 268 333 358 370 373 472 477 580
+@cp java/util/Calendar 1 4 16 25 30 34 37 41 44 48 52 55 99 102 123 171 183 194 200 204 207 256 268 333 358 370 373 472 477 580
@cp java/util/Calendar$Builder 1 4 9 10 15 22 26 75 82 113 119 127 134 167
@cp java/util/Collection 10 55
@cp java/util/Collections 8 13 19 120 180 182 212 215 221 256 278 343 344 354 355 360 368 372 380 384 393 442 469 491 494 497
Comments
[~iklam] Are you tracking a "proper" fix that will restore the cp entries? Or was the gain just too small so it is not worth it?
05-08-2024

Changeset: 7429c37e Author: Ioi Lam <iklam@openjdk.org> Date: 2024-06-25 16:44:41 +0000 URL: https://git.openjdk.org/jdk/commit/7429c37e63ffd50884d91d8f583d409633bfb04d
25-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/19868 Date: 2024-06-24 21:22:48 +0000
24-06-2024

I changed the title of this bug. -XX:DumpLoadedClassList is not guaranteed to be deterministic. The output depends on the behavior of the Java program, which is generally non determinstic. For the JDK build, we use special tools to try to make the default classlist deterministic: - Run a simple, single threaded program - Use an external tool to sort the classlist - Filter out certain non-deterministic or unuseful entries
24-06-2024

Introduced in JDK-8293980
24-06-2024