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

CPIO reports unexpected EOF

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0
    • None
    • None

    Description

      When unpacking an CPIO archive (made with the compress classes or even made with OSX cpio comandline tool) an EOF exception is thrown.
      Here is the testcode:

      final File input = getFile("cmdcreated.cpio");

      final InputStream in = new FileInputStream(input);
      CpioArchiveInputStream cin = new CpioArchiveInputStream(in);

      CpioArchiveEntry entry = null;

      while ((entry = (CpioArchiveEntry) cin.getNextCPIOEntry()) != null)

      { File target = new File(dir, entry.getName()); final OutputStream out = new FileOutputStream(target); IOUtils.copy(in, out); out.close(); }

      cin.close();

      Stacktrace is here:

      java.io.EOFException
      at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.readFully(CpioArchiveInputStream.java:293)
      at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.getNextCPIOEntry(CpioArchiveInputStream.java:168)
      at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStreamTest.testCpioUnpack(CpioArchiveInputStreamTest.java:26)
      ...

      This happens with the first read access to the archive. It occured while my try to improve the testcases.

      Attachments

        1. patch-improvedcpiodocs.txt
          11 kB
          cgrobmeier
        2. patch_cpiotestcases_closing.txt
          8 kB
          cgrobmeier

        Activity

          People

            Unassigned Unassigned
            grobmeier Christian Grobmeier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: