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
{{ message }}
Repository navigation
limits: fd table caps at 1014 with "cannot duplicate fd: Invalid argument"; read counts NUL bytes where cmdsub drops them silently; closed fd 0 then redirect errors #773
Three robustness/limits items, all low severity but all "the shell reports something that isn't true". Measured on master b5793580 (built 2026-10-17 14:25), oracle WSL GNU bash 5.3.0.
The cap is defensible (a Windows handle budget); the diagnostic is not: GNU says Too many open files for this condition, and Invalid argument points the reader at the wrong thing entirely. A script that retries on EMFILE will not recognise this message, and a human will debug the wrong layer.
2. NUL bytes: read counts them, command substitution is silent about them
printf'abc\0def\0\n'> f
x=$(cat f);echo"cmdsub_len=${#x}"
IFS= read -r z < f;echo"read_len=${#z}"
cmdsub_len
read_len
stderr
GNU bash 5.3.0
6
6
warning: command substitution: ignored null byte in input
master b5793580
6
8
(silent)
So the two paths disagree with each other as well as with GNU: the substitution drops the NULs (like GNU, but without the warning that makes it discoverable), while read keeps them and counts them. Note the silence is the part that matters most in this codebase's own taxonomy — it is the same "wrong value, no diagnostic" profile as the other silent items.
3. Closed fd 0, then a redirect: spurious Bad file descriptor
exec0<&-
read y < /dev/null
echo"rc=$? y=[$y]"
stdout
stderr
GNU bash 5.3.0
rc=1 y=[]
(nothing)
master b5793580
rc=1 y=[] — same
read: 0: read error: Bad file descriptor
Exit status and value already match GNU; the only divergence is the diagnostic. Worth folding into whatever "fd 0 is a special case" work is planned (#721 is adjacent), or closing as wording.
Method
Same harness as the catalogue: LF scripts, WSL GNU bash 5.3.0 oracle, arm bounded, fixtures per arm, stdout/stderr/rc separate. All three pinned as catalogue cases in #746.
Same for read -r and multi-var reads. Note read -d "" and mapfile -d "" with NUL-delimited input MATCH GNU — only bare read diverges. Reopening candidate.
Activity
Merge pull request #870 from unixwin/fix/773
Merge pull request #908 from unixwin/arm-761-guards
caomengxuan666 commentedon Oct 22, 2026
Item 2 (bare
readkeeps embedded NULs) still reproduces on niubash 1.4.4 / rubash master ~2026-10:Same for
read -rand multi-var reads. Noteread -d ""andmapfile -d ""with NUL-delimited input MATCH GNU — only barereaddiverges. Reopening candidate.