Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8241602

jlink does not produce reproducible jimage files

XMLWordPrintable

    • b22

        Consider the following:

        $ jlink --add-modules java.se --output image1
        $ jlink --add-modules java.se --output image2
        $ diff -r image image2
        Binary files image1/lib/modules and image2/lib/modules differ

        One issue is that the image writer processes the archives in iteration order and that can vary from run to run. That issue is fixed with `jlink.patch` attached to this bug and it least to make the above reproducible on Linux and macOS. There seems to another issue on Solaris (solaris-sparcv9), maybe because it is big endian. The contents of the image files are identical but the index is different:

        $ jimage info image1/lib/modules
         Major Version: 1
         Minor Version: 0
         Flags: 0
         Resource Count: 17925
         Table Length: 17925
         Offsets Size: 71700
         Redirects Size: 71700
         Locations Size: 359375
         Strings Size: 407279
         Index Size: 910082

        $ jimage info image2/lib/modules
         Major Version: 1
         Minor Version: 0
         Flags: 0
         Resource Count: 17925
         Table Length: 17925
         Offsets Size: 71700
         Redirects Size: 71700
         Locations Size: 358493
         Strings Size: 407279
         Index Size: 909200

        Windows seems to intermittent, most of the time the image is identical but periodically (1 in 100?), it is different.





              jlaskey Jim Laskey
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: