Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

cannot write block : Broken pipe, when cutting pipe in windows

Đang mở
#4,563 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c
Lĩnh vực
cli, operating-systems

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện các lệnh Windows bằng cách chuyển đầu ra của zstd -dc qua pipe tới head -c hoặc dd, đặc biệt là các trường hợp báo cáo Broken pipe hoặc Invalid argument. Theo dõi cách zstd CLI xử lý việc ghi vào stdout và so sánh trạng thái nhận được với hành vi mong đợi: việc dừng lại vì consumer đã đóng pipe không nên được báo cáo là lỗi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
C
Star
28.1k
Fork
2.7k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của facebook/zstd

Tất cả issue của facebook/zstd

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.