F66 archive-no-bytesA zero-byte file: an empty archive, or not an archive?
Tolerate(draft) A strict parser may reject this archive. If it accepts it, it must extract the expected tree below.
F66-archive-no-bytes.tar |
test archive, 0 bytes
sha256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
F66-archive-no-bytes.json | expected result |
F66-archive-no-bytes.txt | annotated blocks |
F66-archive-no-bytes.py | generator script |
The archive is 0 bytes long.
A POSIX archive ends with two zero blocks, which an empty file lacks. A zero-byte file can be left behind by a failed download. Some readers accept it as an archive with no members, while others reject it. The default policy tolerates it, as both extract the same empty tree, and whether a download is complete is known by other means, such as a published checksum.
The expected tree:
| path | kind | contents |
|---|
Decision point: whether a zero-byte file is a valid empty archive.
Seen in: none of the scanned tarballs.
Every block of 512 bytes, to scale, with its offset. Hover over a field for its bytes.
F66-archive-no-bytes: tolerated: a strict parser may reject it; if it accepts it, it must extract its tree, and the default policy accepts it A zero-byte file: an empty archive, or not an archive? The archive is 0 bytes long. A POSIX archive ends with two zero blocks, which an empty file lacks. A zero-byte file can be left behind by a failed download. Some readers accept it as an archive with no members, while others reject it. The default policy tolerates it, as both extract the same empty tree, and whether a download is complete is known by other means, such as a published checksum. Decision point: whether a zero-byte file is a valid empty archive. Seen in: none of the scanned tarballs. See also: F65, an empty archive of two zero blocks, and F04, an archive without an end-of-archive marker. 0x000000 end of file
As xxd writes it: xxd -r makes the archive of it.
In the outcome column, ✅ means that the implementation follows the default policy.
| implementation | version | outcome | what it makes of it |
|---|---|---|---|
| GNU tar | tar (GNU tar) 1.35 | ➖ rejects | error: tar: This does not look like a tar archive tar: Exiting with failure status due to previous errors |
| bsdtar | bsdtar 3.8.11 - libarchive 3.8.11 | ➕ accepts | the expected tree |
| BusyBox tar | BusyBox v1.38.0, defconfig | ➖ rejects | error: tar: short read |
| 7-Zip | 7-Zip (z) 26.05 (x64) | ➖ rejects | error: ERROR: suite/archives/F66-archive-no-bytes.tar Cannot open the file as archive |
| Python tarfile, filter=data, as in pip | CPython 3.15.2 | ➖ rejects | error: ReadError: file could not be opened successfully: - method gz: ReadError('empty file') - method bz2: ReadError('not a bzip2 file') - method xz: ReadError('not an lzma file') - method zst: ReadError('… |
| Python tarfile, filter=tar | CPython 3.15.2 | ➖ rejects | error: ReadError: file could not be opened successfully: - method gz: ReadError('empty file') - method bz2: ReadError('not a bzip2 file') - method xz: ReadError('not an lzma file') - method zst: ReadError('… |
| Python tarfile, filter=fully_trusted | CPython 3.15.2 | ➖ rejects | error: ReadError: file could not be opened successfully: - method gz: ReadError('empty file') - method bz2: ReadError('not a bzip2 file') - method xz: ReadError('not an lzma file') - method zst: ReadError('… |
| node-tar | tar 7.5.22 | ➖ rejects | error: Error: TAR_BAD_ARCHIVE: Unrecognized archive format |
| node-tar, strict | tar 7.5.22 | ➖ rejects | error: Error: TAR_BAD_ARCHIVE: Unrecognized archive format |
| tar-fs | tar-fs 3.1.3, on tar-stream 3.2.2 | ➕ accepts | the expected tree |
| Java Commons Compress | Commons Compress 1.28.0, Expander, on Java 27.0.1.0.2 | ➕ accepts | the expected tree |
| .NET System.Formats.Tar | System.Formats.Tar of .NET 10.0.14, ExtractToDirectory | ➕ accepts | the expected tree |
| PHP PharData, as in Composer | PharData of PHP 8.5.12, as Composer's TarDownloader calls it | ➖ rejects | error: UnexpectedValueException: internal corruption of phar "suite/archives/F66-archive-no-bytes.tar" (truncated entry) |
| Go containerd archive.Apply | containerd v2.4.2, archive.Apply, of go1.27.3 | ➕ accepts | the expected tree |
| Rust tar | tar 0.4.46, unpack | ➕ accepts | the expected tree |
| Rust astral-tokio-tar | astral-tokio-tar 0.7.1, unpack | ➕ accepts | the expected tree |
| Rust tar-codec, as in uv | tar-codec 0.0.16, with the policies of uv 0.13 | ➖ rejects | error: at byte 0: missing two-block end-of-archive marker |
| RubyGems | RubyGems 4.0.20 of Ruby 4.0.9, extract_tar_gz | ➕ accepts | the expected tree |
| R untar, internal | utils::untar of R 4.6.2, tar = "internal" | ➕ accepts | the expected tree |
| Perl Archive::Tar | Archive::Tar 3.12 of Perl v5.44.0 | ➖ rejects | error: status 1 |
| Haskell tar | tar 0.7.2.0, extract, of GHC 9.14 | ➖ rejects | error: TruncatedArchive |
| Julia Tar.jl | Tar 1.10.0 of Julia 1.13.3 | ➕ accepts | the expected tree |
| untar (PyPI) | untar 0.5.0, extract, on CPython 3.15.2 | ➖ rejects | error: Error: Archive is empty |
| live-bootstrap untar | mescc-tools-extra a151c245e512, as live-bootstrap pins it | ➖ rejects | error: Short read on suite/archives/F66-archive-no-bytes.tar: expected 512, got 0 The extraction of suite/archives/F66-archive-no-bytes.tar produced errors |
| live-bootstrap untar, --non-strict | mescc-tools-extra a151c245e512, as live-bootstrap pins it | ➖ rejects | error: non-strict mode enabled, preparing for chaos Short read on suite/archives/F66-archive-no-bytes.tar: expected 512, got 0 The extraction of suite/archives/F66-archive-no-bytes.tar produced errors |
The table below shows how many release tarballs have the features of this test case.
| ecosystem | tarballs | with it | share |
|---|---|---|---|
| Spack | 37,553 | 0 | none |
| nixpkgs | 18,990 | 0 | none |
| Guix | 10,168 | 0 | none |
| PyPI | 10,000 | 0 | none |
| crates.io | 5,000 | 0 | none |
| RubyGems | 5,000 | 0 | none |
| live-bootstrap | 171 | 0 | none |
| total (distinct) | 82,586 | 0 | none |