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
The read builtin hangs forever when reading from /dev/stdin. In CI / container entrypoints, read < /dev/stdin is a common idiom, so this is a hard hang, not a wrong value.
Environment: Niubash 1.4.0 · rubash git e785c3c8f610 — Windows 10 x64. Method: differential vs GNU bash 5.2.21(1) / 5.3.0.
Repro
$ printf'SIN\n'| niu -c 'read -r z < /dev/stdin; echo "got=[$z]"'# niu: never returns — killed at 6s (rc 124)# bash: got=[SIN]
Also hangs with stdin from a regular file:
$ { read -r z < /dev/stdin;echo"got=[$z]"; } < somefile
# niu: hangs# bash: prints the line
Not the redirection itself
External commands on the same path are fine:
$ printf'SIN\n'| head -1 < /dev/stdin
niu : SIN # works
So /dev/stdin resolves for external children, but the read builtin blocks on it.
Severity
Hang with no output and no exit — matches this repo's P0-critical definition (卡死). Scripts that use read < /dev/stdin become permanently stuck under niu.
Version note (correction to the Method line): the oracle was reached with bare wsl.exe -e bash, which resolves through PATH to /usr/local/bin/bash = GNU bash 5.3.0(1) — not 5.2.21. The 5.2.21 build lives at /bin/bash, and every item in this report was re-checked on it as well; results were identical on both.
So the two versions are listed in the wrong order above: 5.3.0 was the default, 5.2.21 the cross-check.
No finding here changes; noting it only so the numbers reproduce. (Incidentally 5.3.0 is also the oracle cited in rubash#641, "the repository oracle is WSL 5.3.0".)
Activity
caomengxuan666 commentedon Oct 17, 2026
Version note (correction to the Method line): the oracle was reached with bare
wsl.exe -e bash, which resolves through PATH to/usr/local/bin/bash= GNU bash 5.3.0(1) — not 5.2.21. The 5.2.21 build lives at/bin/bash, and every item in this report was re-checked on it as well; results were identical on both.So the two versions are listed in the wrong order above: 5.3.0 was the default, 5.2.21 the cross-check.
No finding here changes; noting it only so the numbers reproduce. (Incidentally 5.3.0 is also the oracle cited in rubash#641, "the repository oracle is WSL 5.3.0".)
fix(read): resolve /dev/stdin + EOF-without-delimiter in the read bui…
fix(read): serve fd-0 self-dups through the ordinary fd-0 transports (#…