www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/11/13/12:50:32

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: 13 Nov 2001 12:45:25 -0500
Message-ID: <20011113174525.4108.qmail@lizard.curl.com>
From: Jonathan Kamens <jik AT curl DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: "Address already in use" error from ssh with current Cygwin installation

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019