Closed stephane-chazelas closed 1 year ago
Note that #2047 and #2048 were found while working on https://unix.stackexchange.com/questions/757832/how-to-process-json-with-strings-containing-invalid-utf-8/758016#758016
vd -f json <(cmd)
in place of cmd | vd -f json
is a way to work around #2047 and cmd | vd -f json
in place of vd -f json <(cmd)
is a way to work around #2048 so it's hard to work around both.
One can use zsh's =(...)
form of command substitution (vd -f json =(cmd)
) but that's not ideal as cmd
and vd
no longer run concurrently and the whole output needs to be stored on the filesystem.
Hi @stephane-chazelas, thanks for the detailed report. This does repro in v2.11.1 (the latest release) but doesn't on the develop branch, likely fixed with #1955. Please let us know if you have similar issues that repro on develop!
Description
vd -f json /path/to/fifo
as invd -f json <(some command)
(here from a shell with support for Korn-style process substitution such as zsh or bash) often fails randomly.It can be reproduced consistently with:
Which fails with:
Above the
sleep 1
ensures the firstread(2)
vd
does only returns[{"foo":1\n
. As seen bystrace
:When the input is read from stdin, as in:
The problem does not occur.
Strack trace obtained with
^E
:Additional context