diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2025-02-24 13:22:36 -0800 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2025-02-24 22:33:44 +0100 |
commit | 11a84cc757ef766505ed037c88c21d87b457862d (patch) | |
tree | 22a5e434c5b266665995d8fc8426eacc9878fd85 /newlib/libc/stdlib | |
parent | 78ff40d78ef64313b73834500c3f7775e64e534f (diff) | |
download | newlib-11a84cc757ef766505ed037c88c21d87b457862d.zip newlib-11a84cc757ef766505ed037c88c21d87b457862d.tar.gz newlib-11a84cc757ef766505ed037c88c21d87b457862d.tar.bz2 |
Cygwin: fix SSH hangs
It was reported in https://github.com/git-for-windows/git/issues/5199
that as of v3.5.4, cloning or fetching via SSH is hanging indefinitely.
Bisecting the problem points to 555afcb2f3 (Cygwin: select: set pipe
writable only if PIPE_BUF bytes left, 2024-08-18). That commit's
intention seems to look at the write buffer, and only report the pipe as
writable if there are more than one page (4kB) available.
However, the number that is looked up is the number of bytes that are
already in the buffer, ready to be read, and further analysis
shows that in the scenario described in the report, the number of
available bytes is substantially below `PIPE_BUF`, but as long as they
are not handled, there is apparently a dead-lock.
Since the old logic worked, and the new logic causes a dead-lock, let's
essentially revert 555afcb2f3a6 ("Cygwin: select: set pipe writable only if
PIPE_BUF bytes left").
Note: This is not a straight revert, as the code in question has been
modified subsequently, and trying to revert the original commit would
cause merge conflicts. Therefore, the diff looks very different from the
reverse diff of the commit whose logic is reverted.
Fixes: 555afcb2f3a6 ("Cygwin: select: set pipe writable only if PIPE_BUF bytes left")
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'newlib/libc/stdlib')
0 files changed, 0 insertions, 0 deletions