delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/13/15:20:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Tue, 13 Apr 2010 21:20:10 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: configure test for accept4 hangs
Message-ID: <20100413192010.GM28908@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4BC4AD2D DOT 1040209 AT acm DOT org>
MIME-Version: 1.0
In-Reply-To: <4BC4AD2D.1040209@acm.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Apr 13 10:43, David Rothenberger wrote:
> While configuring apr-1.4.2 with Cygwin 1.7.5, the test for accept4
> hung. I don't know much about this API, so I've just disabled it in
> libapr1 for now, but I wanted to report the hang in case it was a
> Cygwin bug.

Boy, this testcase is really stressing the limits.

The problem is that connect() is called in that loop so fast, that at
one point the AF_UNIX socket file already exists, but is not yet filled
with the information necessary to be recognized as AF_UNIX socket.
Consequentially, at that point connect() fails with EBADF, since it
assumes you're trying to connect to a file which is not a socket.

The hang is just a followup effect due to the parent waiting in accept()
for a connect() which will never happen, because the child process
already left the connect() loop.

I try to come up with a more robust solution which also catches this
scenario.


Thanks for the testcase,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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