-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
non-msys2 programs touching a pipe's read side makes the write side unselectable #4850
Comments
This sounds like it might be related to msys2/msys2-runtime#202 |
Thanks for the link to the msys2 issue, it definitely has elements in common with what I'm seeing. Maybe a difference is that in this issue, it's intended that the external program curl be done before the select. The other side of the pipe is only I see why
@dscho: reproduces in Portable Git. Reproduces after replacing msys-2.0.dll as well. |
Does it also reproduce with plain Cygwin? |
reproduces in plain Cygwin, when using Windows 10's built in curl.exe. Cygwin also distributes its own built of curl, which doesn't cause this, similar to how using msys2 programs didn't cause this hang either. tested with cygwin 3.5.1-1 |
@wh0 would you mind reporting this to the Cygwin project? They are usually very responsive and helpful about clear and complete bug reports. |
This has been fixed in cygwin/cygwin@fc691d0 and a Cygwin 3.5.2 is on the horizon, so we'll probably be able to pick this up in time for Git for Windows 2.45.0 |
I added a backport of this patch to git-for-windows/msys2-runtime#68. @wh0 would you mind testing after overwriting the |
The version with the backport works. 🎉 $ ./test3.pl | (curl --version && cat)
curl 8.6.0 (x86_64-w64-mingw32) ...
selecting
ready
abc |
Since the backport was merged, I assume that this ticket can be closed. |
Setup
64-bit
Windows 10 22H2 64-bit
defaults?
to the issue you're seeing?
don't think so 🤞
Details
Git Bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
in test3.pl:
then run:
the pipe between perl and that subshell should be writable. the select should return and 'abc' should get piped through cat and show up.
☝️ and at this point you can't even ctrl+c it
using strace on perl, it ends with
pipesel just never comes back
and what's extra weird:
cat
withtee
(tee with no args is the same as cat) makes it workcurl
makes it workcurl </dev/null
to make curl not touch stdin makes it workid
instead ofcurl
makes it workselect
confirms that nothing weird is breaking the pipe, and theabc
shows up properlyURL to that repository to help us with testing?
we're several layers deep, but this "curl and then cat" behavior originated in this script that's meant to run as a ProxyCommand for using Git over SSH:
https://gitlab.com/wh0/te/-/blob/client/te-relay?ref_type=heads#L31
OpenSSH client does the selecting in its client loop. I've replaced it with a script for simplicity.
The text was updated successfully, but these errors were encountered: