X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Message-ID: <4BC5D833.8050901@acm.org> Date: Wed, 14 Apr 2010 07:58:59 -0700 From: David Rothenberger User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: configure test for accept4 hangs References: <4BC4AD2D DOT 1040209 AT acm DOT org> <20100413192010 DOT GM28908 AT calimero DOT vinschen DOT de> <20100413195818 DOT GN28908 AT calimero DOT vinschen DOT de> In-Reply-To: <20100413195818.GN28908@calimero.vinschen.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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 4/13/2010 12:58 PM, Corinna Vinschen wrote: > On Apr 13 21:20, Corinna Vinschen wrote: >> 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. > > In CVS I just changed the way the socket file gets created in bind() and > the way it's tested for being a socket file in connect() so this timing > problem shouldn't occur anymore. Would you mind to test either CVS or > the next developers snapshot from http://cygwin.com/snapshots/ ? The configure succeeds with the developers snapshot, as do the APR tests. Thanks for the fix. -- David Rothenberger ---- daveroth AT acm DOT org "Buy land. They've stopped making it." -- Mark Twain -- 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