Mail Archives: cygwin-developers/2001/11/13/12:50:32
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
- Raw text -