Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#4,563 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c

Direzione di ricerca

Inizia riproducendo i comandi Windows usando zstd -dc instradato a head -c o dd, soprattutto nei casi che segnalano Broken pipe o Invalid argument. Traccia la gestione delle scritture su stdout di zstd CLI e confronta lo stato risultante con il comportamento previsto: l'arresto perché il consumer ha chiuso la pipe non dovrebbe essere segnalato come errore.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
C
Stelle
28.1k
Fork
2.7k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di facebook/zstd

Tutte le issue di facebook/zstd

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.