Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-565

Regression - Corrupted headers when using 64 bit ZipArchiveOutputStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.20
    • 1.21
    • Archivers
    • None

    Description

      We've recently updated commons-compress library from version 1.9 to 1.20 and now experiencing the problem that didn't occur before.

       

      When using ZipArchiveOutputStream to archive 5Gb file and setting the following fields

      output.setUseZip64(Zip64Mode.Always)
      output.setCreateUnicodeExtraFields(ZipArchiveOutputStream.UnicodeExtraFieldPolicy.ALWAYS)

      resulting archive contains corrupted headers.

      Expand-Archive Powershell utility cannot extract the archive at all with the error about corrupted header. 7zip also complains about it, but can extract the archive.

       

      The problem didn't appear when using library version 1.9.

       

      I've created a sample project that reproduces the error - https://github.com/missingdays/commons-compress-example

      Issue doesn't reproduce if you do any of the following:

       

      1. Downgrade library to version 1.9
      2. Remove output.setCreateUnicodeExtraFields(ZipArchiveOutputStream.UnicodeExtraFieldPolicy.ALWAYS)
      3. Remove output.setUseZip64(Zip64Mode.Always) and zip smaller file (e.g. 1Gb)

      Attachments

        1. commons-compress-1.21-SNAPSHOT.jar
          616 kB
          Stefan Bodewig
        2. image-2021-02-20-15-51-21-747.png
          34 kB
          Peter Lee

        Issue Links

          Activity

            People

              peterlee Peter Lee
              evgenii.bovykin Evgenii Bovykin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4.5h
                  4.5h