Skip to content

bsdtar : ok with --file, corrupt with pipe output ? #2475

Open
@Tunoac

Description

Hello,
I encountered a strange issue on Arch Linux:
bsdtar works with a file output (01), but has a corrupt output in pipe mode (02):

$ file=textfile.txt
$ echo 'Hello World.' > ${file}

$ bsdtar --create --verbose --zstd --options zstd:threads=4  --file "${file}-01.tar.zst" "${file}"
a textfile.txt

$ bsdtar --create --verbose --zstd --options zstd:threads=4  --file -                    "${file}" > "${file}-02.tar.zst"
a textfile.txt

$ bsdtar tf "${file}-01.tar.zst"
textfile.txt

$ bsdtar tf "${file}-02.tar.zst"
bsdtar: Error opening archive: Zstd decompression failed: Unknown frame descriptor

$ ls -la ${file}*
-rw------- 1 xxx xxx    13 Dec 31 12:30 textfile.txt
-rw------- 1 xxx xxx   111 Dec 31 12:30 textfile.txt-01.tar.zst
-rw------- 1 xxx xxx 10240 Dec 31 12:30 textfile.txt-02.tar.zst

$ bsdtar --version
bsdtar 3.7.7 - libarchive 3.7.7 zlib/1.3.1 liblzma/5.6.3 bz2lib/1.0.8 liblz4/1.10.0 libzstd/1.5.6 

Comparing the two tar.zst files: both have the same binary data at the beginning, 02 has then a lot 00-bytes extra.
The issue matters, when you plan to pipe the bsdtar data to the next app.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions