This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
"Address already in use" error from ssh with current Cygwin installation
- To: cygwin-developers at cygwin dot com
- Subject: "Address already in use" error from ssh with current Cygwin installation
- From: Jonathan Kamens <jik at curl dot com>
- Date: 13 Nov 2001 12:45:25 -0500
[Get raw message]
[Get raw message]
I just upgraded Cygwin on one of our build servers so that it has all
of the most recent Cygwin packages, including version 1.3.5 of the
DLL, installed.
Shortly afterwards, I got this error from ssh:
ssh: connect to address XXX.XXX.XXX.XXX port 22: Address already in use
I managed to duplicate it on an SMP machine running Windows NT with
this command:
while ssh HOST date; do true; done
HOST is a host on our internal network, i.e., the network to it is
very fast. I was unable to duplicate the problem on a uniprocessor
machine.
When I run "netstat" immediately after the failure, I see a whole
bunch of connections to sshd on the remote host in TIME_WAIT status.
When I peruse fhandler_socket.cc, it appears to me that the code is
randomly assigning a local port number to a socket during connect. Is
that correct? If so, then that presumably explains the problem --
sometimes the random port number conflicts with one that's already in
use (but this doesn't explain why I couldn't duplicate the problem on
a uniprocessor machine).
If someone here can confirm that my understanding of the code in
fhandler_socket.cc is correct and that my theory for what is causing
the bug is thus also correct, then I will begin working on figuring
out how to fix it. Although I don't have any ideas off the top of my
head, so I'm open to suggestions :-).
Thanks,
jik