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

Writing 7z empty entries produces incorrect or corrupt archive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.6
    • 1.7
    • Archivers
    • eclipse 3.7.2, java 1.7

    Description

      I couldn't find an exact rule that causes this incorrect behavior, but I tried to reduce it to some simple scenarios to reproduce it:

      Input: A folder with certain files -> tried to archive it.
      If the folder contains more than 7 files the incorrect behavior appears.

      Scenario 1: 7 empty files
      Result: The created archive contains a single folder entry with the name of the archive (no matter which was the name of the file)

      Scenario 2: 7 files, some empty, some with content
      Result: The created archive contains a folder entry with the name of the archive and a number of file entries also with the name of the archive. The number of the entries is equal to the number of non empty files.

      Scenario 3: 8 empty files
      Result: 7zip Manager cannot open archive and stops working.

      Scenario 4.1: 8 files: some empty, some with content, last file (alphabetically) with content
      Result: same behavior as described for Scenario 2.

      Scenario 4.2: 8 files, some empty, some with content, last file empy
      Result: archive is corrupt, the following message is received: "Cannot open file 'archivename.7z' as archive" (7Zip Manager does not crash).

      Attachments

        1. CreateArchiveTest.java
          2 kB
          Livia Sarbu
        2. EmptyTest.zip
          1 kB
          Livia Sarbu
        3. Scenario2and4.1.jpg
          47 kB
          Livia Sarbu
        4. Scenario3.jpg
          44 kB
          Livia Sarbu
        5. Scenario4.2.jpg
          13 kB
          Livia Sarbu

        Activity

          People

            Unassigned Unassigned
            Livia Livia Sarbu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: