On 6/10/2024 8:12 PM, Holger Klene via Cygwin wrote:
This is:
GNU bash, Version 5.2.21(1)-release (x86_64-pc-cygwin)
Was also reproduced in git-bash 5.2.26(1)-release (also cygwin)
but not in WSL-bash 5.1.16 (independent of cygwin)
This regression is introduced in bash-5.1, Introduced changes in both
here-string, here-document in 5.1 caused hangs.
Apart from that, unlike to Linux, Cygwin chunks io of pipe into 64K and
NtWriteFile writes to a pipe even after the pipe exceeded buffer size
while reporting STATUS_PENDING, So in Cygwin, divide by 2 of actual
buffer size is within boundary of pipe buffer as seen below.
$ dd if=/dev/urandom bs=63K status=progress | sleep 3
129024 bytes (129 kB, 126 KiB) copied, 3 s, 42.8 kB/s
$ dd if=/dev/urandom bs=128 status=progress | sleep 3
65664 bytes (66 kB, 64 KiB) copied, 3 s, 21.9 kB/s
And current bash package make wrong estimate of pipe size of host
environment according to builtins/psize.sh of cygport source package of
bash.
====
Excerpt from builtins/psize.sh of bash, You can guess what the result
will be From the above.
./psize.aux 2>"$TMPFILE" | sleep 3
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple