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

-Xbootclasspath can not read some ZIP64 zip files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 24, 25
    • core-libs
    • None
    • Fix Understood
    • generic
    • generic

      [Filing on behalf of Thomas Fitzsimmons]

      It should be possible to use a Zip64 zip file on bootclasspath, however currently classes therein are not found because zip_util.c's readCEN function does not recognize the Zip64 file's signature.

      Here are steps to reproduce the issue, adapted from
      https://bugzilla.redhat.com/show_bug.cgi?id=1433262:

      $ wget -O TestZip.java "https://bugzilla-attachments.redhat.com/attachment.cgi?id=1263973"
      [...]
      $ $JAVA_HOME/bin/javac TestZip.java
      $ dd if=/dev/zero of=8192m count=0 bs=1 seek=8192M
      [...]
      $ zip 8192m.zip 8192m TestZip.class
      [...]
      $ rm TestZip.class
      $ $JAVA_HOME/bin/java -Xbootclasspath/a:8192m.zip TestZip 8192m.zip
      Error: Could not find or load main class TestZip
      Caused by: java.lang.ClassNotFoundException: TestZip
      $

      After applying the zip_util.c patch in this pull request:

      https://github.com/openjdk/jdk8u-dev/pull/452/commits/462cd916c26f9745abca2cfd78ed8d1107db9f0c#diff-8d483a644ca2cac134729b3685188e876a43697a494c9cd6e0dad1ac6d545cd4

      TestZip.class is found in 8192m.zip, and the test succeeds:

      $ $JAVA_HOME/bin/java -Xbootclasspath/a:8192m.zip TestZip 8192m.zip
       -> 8192m
       -> TestZip.class
      Succeeded to inspect packed file
      $

      This patch is based on the Java version of the same fix from JDK-8186464, which can not be directly backported to 8u due to the absence of JDK-8145260, which moves the userspace implementation to Java. This change is thus more important for 8u because zip_util.c is the sole zip implementation there and so this also affects user code. However, it makes sense to have the logic fixed in master too.

      Assuming this is accepted, I will backport it to 23, 21, 17, 11 and 8.

            andrew Andrew Hughes
            andrew Andrew Hughes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: