X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Sat, 22 May 2010 11:48:09 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: 1.7.1: Bind 9.6.0-P1 on Vista: could not listen on UDP socket: not enough free resources (patch attached)
Message-ID: <20100522154808.GA14004@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4B796E07.6080203@hp.com> <20100518211356.GA18141@cyclonus.mozone.net> <20100522120111.GA21401@cyclonus.mozone.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20100522120111.GA21401@cyclonus.mozone.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Sat, May 22, 2010 at 05:01:11AM -0700, mki-cygwin@mozone.net wrote:
>On Tue, May 18, 2010 at 02:13:56PM -0700, you wrote:
>> > 15-Feb-2010 16:33:36.437 socket: file descriptor exceeds limit (128/64)
>> 
>> Not sure why this is happening other than the default limits not being 
>> honored and/or get botched by setrlimit() in there somewhere...
>
>So the issue with named not being able to bind to the ports is related
>to the default FD_SETSIZE limit of 64.  When accept returns an fd, it
>seems to be some value above 128.  Since FD_SETSIZE is 64, the fd_set
>structures all get created with that size and trying to call select
>with maxfds set to something greater than 64 results in select
>indefinetly spewing -1 with EBADF as errno.
>
>The workaround I found was to recompile the sources, but making sure
>that -DFD_SETSIZE=16384 is defined during the configure stage.  Patch
>attached below.
>
>Can someone please update the port with this bumped up FD_SETSIZE patch?

If FD_SETSIZE is used to control what goes into one of the fd_set arguments
to select() this won't work too well.

fd's are allocated monotonically starting with 0 so if accept() is really 
returning something greater than 63 someone should figure out why.

cgf

--
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

