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

JDK 9 b64 breaks bzip2 decompression of Commons Compress and Ant

    XMLWordPrintable

Details

    • x86_64
    • linux

    Description

      FULL PRODUCT VERSION :
      java version "1.9.0-ea"
      Java(TM) SE Runtime Environment (build 1.9.0-ea-b65)
      Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b65, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

      but the same behavior has been confirmed for Windows (unknown version) as well

      A DESCRIPTION OF THE PROBLEM :
      The code inside of Commons Compress runs into random Exceptions after the VM has been warmed up that don't occur with JDK8. The exceptions indicate internal arrays got corrupted, the "after the VM has been warmed up" point into the direction of the JIT - so maybe I've picked the wrong product category.


      ADDITIONAL REGRESSION INFORMATION:
      java version "1.9.0-ea"
      Java(TM) SE Runtime Environment (build 1.9.0-ea-b65)
      Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b65, mixed mode)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile

      import org.apache.commons.compress.utils.IOUtils;
      public class Bzip2DecompressorLoop {
           public static void main(String[] args) throws IOException {
               int loops = 0;
               while (true) {
                   ByteArrayOutputStream devNull = new ByteArrayOutputStream();
                   BZip2CompressorInputStream in = new BZip2CompressorInputStream(new FileInputStream("bla.tar.bz2"));
                   IOUtils.copy(in, devNull);
                   System.err.println("Finished loop: " + (loops++));
               }
           }
      }

      against Apache Commons Compress 1.9. Run it using https://svn.apache.org/repos/asf/commons/proper/compress/trunk/src/test/resources/bla.txt.bz2 as input file.

      It's not always the same number but somewhere around "loop 53" I get a
      "BZip2 CRC error" when using JDK 9 b64 - this is after decompressing the
      same file several times without any problems. With JDK8 I never get any exception.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Arbitrary loops of the program above without any exception.
      ACTUAL -
      An exception.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No crash at all.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      see above
      ---------- END SOURCE ----------

      Attachments

        1. apache-commons.jar
          837 kB
        2. bla.txt.bz2
          0.1 kB
        3. Bzip2DecompressorLoop.java
          0.7 kB
        4. commons-compress-1.2.jar
          165 kB

        Issue Links

          Activity

            People

              roland Roland Westrelin
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: