cannot write block : Broken pipe, when cutting pipe in windows
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- c
- 领域
- cli, operating-systems
调研方向
首先,使用将 zstd -dc 通过管道传给 head -c 或 dd 的方式重现 Windows 命令,尤其是报告 Broken pipe 或 Invalid argument 的情况。跟踪 zstd CLI 对 stdout 写入的处理,并将得到的状态与预期行为进行比较:因消费者关闭管道而停止不应被报告为错误。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
In windows (here: 7, x64) decompressing to stdout and piping it to head or dd ends with an error if they don't consume all input.
To Reproduce
Tested on ep_meps.json.zst from parltrack dumps.
$ zstd -V
*** Zstandard CLI (64-bit) v1.5.7, by Yann Collet ***
$ zstd -dc ep_meps.json.zst > ep_meps.json
$ zstd -dc ep_meps.json.zst | head -c 1000 > ep_meps.json.1k
zstd: error 70 : Write error : cannot write block : Broken pipe
$ zstd -dc ep_meps.json.zst | head -c 1000000 > ep_meps.json.1M
zstd: error 70 : Write error : cannot write block : Invalid argument
$ zstd -dc ep_meps.json.zst | head -c 10000000 > ep_meps.json.10M
zstd: error 70 : Write error : cannot write block : Broken pipe
$ zstd -dc ep_meps.json.zst | head -c 100000000 > ep_meps.json.100M
zstd: error 70 : Write error : cannot write block : Broken pipe
Which in my opinion is not an error.
Others don't do that:
$ gzip -dc ep_meps.json.gz | head -c 1000000 > nul
$ bzip2 -dc ep_meps.json.bz2 | head -c 1000000 > nul
$ unzip -p ep_meps.json.zip | head -c 1000000 > nul
Although some do:
$ pigz -dc ep_meps.json.gz | head -c 1000000 > nul
error on <stdout> (Invalid argument)
$ 7z x -so ep_meps.json.gz | head -c 1000000 > nul
ERROR: The pipe is being closed.
$ lzip -dc ep_meps.json.lz | head -c 1000000 > nul
lzip: Write error: Broken pipe
Which is weird.
I cannot compare it wit *nix, as I can't jump switch to linux just like that, nor just for that, but I don't remember ever having such issue there.
Expected behavior
I don't consider it error. If something than maybe warning, but not an error as it suggests that something wrong happened when it's not the case.
Desktop (please complete the following information):
- OS: Windows 7, x64
- Compiler: ? (release downloaded from github or sourceforge)
- Flags: default
- 主要语言
- C
- 星标
- 28.1k
- 派生
- 2.7k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
facebook/zstd 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
cmake: AddZstdCompilationFlags still depends on C++ after #4357可能已有人在做 @Tyagiquamar 于 30 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
ZSTD_compressSequencesAndLiterals() does not enforce its documented litCapacity >= litSize + 8 contract — the implemented check is 8 bytes weaker than the API documentation, its own error message, and the introducing commit可能已有人在做 @KSAGlory 于 50 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
-
seekable_format warning with -DNDEBUG: potential uninitialised local variable newOffset used可能已有人在做 @i098 于 19 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
相似的 Issue
-
documentation
难度 1/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
0.kind: build failure
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 2 天内回复