bugzilla-daemon at bugzilla.mindrot.org
2019-Jun-25 16:08 UTC
[Bug 3022] New: "dup() in/out/err failed" is output when stdin, stdout, or stderr is a TCP/IP socket
https://bugzilla.mindrot.org/show_bug.cgi?id=3022
Bug ID: 3022
Summary: "dup() in/out/err failed" is output when stdin,
stdout, or stderr is a TCP/IP socket
Product: Portable OpenSSH
Version: 8.0p1
Hardware: ix86
OS: Windows 10
Status: NEW
Severity: normal
Priority: P5
Component: ssh
Assignee: unassigned-bugs at mindrot.org
Reporter: minidino at mailinator.com
Due to limitations in Windows, the CreateProcess() API accepts
anonymous pipes for the stdin, stdout, and stderr handles. However,
buried in the MSDN docs is information that states that anonymous pipes
cannot be made non-blocking. This creates a situation where two
processes can deadlock (e.g. one process is blocking on stdin while
another process is blocking on stdout or stderr).
There are two known fixes for this on Windows: Use multiple threads
(one thread for each pipe) or use a little-known mode of
CreateProcess() and pass connected TCP/IP socket handles for each of
the pipes to the target process instead of anonymous pipes. Not all
languages support multithreading and using a thread per pipe is kind of
wasteful of system resources. Of course, establishing a TCP/IP
connection per pipe is also wasteful but enables single-threaded,
non-blocking code to work without deadlocking both processes. Most
processes work fine with TCP/IP stdout/stderr (TCP/IP stdin is a bit
more iffy and depends on how the underlying C library works).
OpenSSH calls dup() in ssh.c and then bails out with the error message
"dup() in/out/err failed" when it can't duplicate socket
handle(s).
The connection then terminates.
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2019-Sep-05 12:11 UTC
[Bug 3022] "dup() in/out/err failed" is output when stdin, stdout, or stderr is a TCP/IP socket
https://bugzilla.mindrot.org/show_bug.cgi?id=3022
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |djm at mindrot.org
--- Comment #1 from Damien Miller <djm at mindrot.org> ---
Is this issue with the Cygwin support in portable OpenSSH or the
Microsoft OpenSSH port?
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2022-Jan-14 04:44 UTC
[Bug 3022] "dup() in/out/err failed" is output when stdin, stdout, or stderr is a TCP/IP socket
https://bugzilla.mindrot.org/show_bug.cgi?id=3022
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WORKSFORME
--- Comment #2 from Damien Miller <djm at mindrot.org> ---
closing for lack of followup
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2022-Feb-25 02:59 UTC
[Bug 3022] "dup() in/out/err failed" is output when stdin, stdout, or stderr is a TCP/IP socket
https://bugzilla.mindrot.org/show_bug.cgi?id=3022
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #3 from Damien Miller <djm at mindrot.org> ---
closing bugs resolved before openssh-8.9
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.