Bug 2964 - OpenSSH for Windows often hangs if no data sent over the connection
Summary: OpenSSH for Windows often hangs if no data sent over the connection
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 7.9p1
Hardware: Other Windows 10
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-06 08:46 AEDT by leese
Modified: 2021-04-23 14:58 AEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description leese 2019-02-06 08:46:50 AEDT
This was reproduced on both 7.7p1 and 7.9p1, while ssh-ing from a Windows machine to a Linux machine. For a simple repro I'm using the bash commands `echo ""` (should output a single newline) and `echo -n ""` (should output nothing and immediately exit successfully; I've also used /bin/true which is equivalent.)

> ssh user@host -- echo ""

Reliably returns right away as expected.

> ssh user@host -tt -- echo ""

Reliably returns right away as expected.

> ssh user@host -- echo -n ""

Seems to hang, but if you press a key it returns.

> ssh user@host -tt -- echo -n ""

Sometimes it works, sometimes it hangs. When it hangs it will be unresponsive to input, including ^C. You need to kill it in task manager. A wireshark trace shows that the server sent the TCP FIN packet, but the client is still holding open the connection.

> ssh user@host -tt -v -- echo -n ""

Turning on verbose output seems to make it work reliably.

Not sure to what extent network latency affects this but my ping time is 11ms.
Comment 1 Jakub Jelen 2019-02-06 20:24:46 AEDT
This could be related to the bug #2071 which is there for ages and has similar symptoms also on Linux platforms. You can try the patch I proposed there few years back if it solves also your problem.
Comment 2 Damien Miller 2019-02-08 14:56:19 AEDT
What client are you using? Are you using the Microsoft ssh client or the Cygwin one?
Comment 3 leese 2019-02-09 03:42:10 AEDT
I'm using the Microsoft client. I filed a bug with them:

https://github.com/PowerShell/Win32-OpenSSH/issues/1338
Comment 4 Damien Miller 2021-04-23 14:58:14 AEST
closing resolved bugs as of 8.6p1 release