You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In normal operation the - should be treated as stdin. When compressing multiple files and one of them is - the cli incorrectly attempts to make a file named stdin.zst and segfaults.
To Reproduce
zstd
cd $(mktemp -d)
echo oops > !
echo oh no > -
zstd ! -
zstd: /*stdin*\.zst: Permission denied 280%
fish: Job 1, 'zstd *' terminated by signal SIGSEGV (Address boundary error)
-f makes no difference here and still a segfault
gzip
cd $(mktemp -d)
echo oops > !
echo oh no > -
gzip ! -
gzip: compressed data not written to a terminal. Use -f to force compression.
For help, type: gzip -h
If zstd - ! is passed, zstd will propogate the stdin->stdout behavior to all other files.
cd $(mktemp -d)
echo oops > !
zstd - ! -f
hello
(/X1hello
S(/$)oops
�5~⏎
however gzip does not propogate this behavior
cd $(mktemp -d)
echo oops > !
gzip - ! -f
hello
lQ���� 0:6⏎
Expected behavior
zstd should print stdin is a console, aborting or if -f is passed, wait for standard input and write it to standard output in between doing the other file behaviors. This matches what gzip does.
Desktop
linux - zstd 1.5.2 built from source
Let me know thoughts a fix and I am happy to move forward with a PR.
The text was updated successfully, but these errors were encountered:
Zstd should definitely treat - as stdin when compressing multiple files, and only write that single file to stdout.
We'll make sure to fix this in our next release. I think this one might be a somewhat tricky one to fix, so I'd recommend leaving it to us. However, the pass-through mode issues would be a good candidate to work on.
Describe the bug
In normal operation the
-
should be treated asstdin
. When compressing multiple files and one of them is-
the cli incorrectly attempts to make a file namedstdin.zst
and segfaults.To Reproduce
zstd
-f
makes no difference here and still a segfaultgzip
If
zstd - !
is passed, zstd will propogate the stdin->stdout behavior to all other files.however gzip does not propogate this behavior
Expected behavior
zstd should print
stdin is a console, aborting
or if-f
is passed, wait for standard input and write it to standard output in between doing the other file behaviors. This matches what gzip does.Desktop
linux - zstd 1.5.2 built from source
Let me know thoughts a fix and I am happy to move forward with a PR.
The text was updated successfully, but these errors were encountered: