X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=1.0 required=5.0 tests=AWL,BAYES_20,SPF_HELO_PASS,TW_YG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Date: Sat, 22 May 2010 13:45:08 -0700 From: mki-cygwin AT mozone DOT net To: cygwin AT cygwin DOT 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: <20100522204508.GB21401@cyclonus.mozone.net> References: <4B796E07 DOT 6080203 AT hp DOT com> <20100518211356 DOT GA18141 AT cyclonus DOT mozone DOT net> <20100522120111 DOT GA21401 AT cyclonus DOT mozone DOT net> <20100522154808 DOT GA14004 AT ednor DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100522154808.GA14004@ednor.casa.cgf.cx> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Sat, May 22, 2010 at 11:48:09AM -0400, Christopher Faylor wrote: > On Sat, May 22, 2010 at 05:01:11AM -0700, mki-cygwin AT mozone DOT net wrote: > >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. Actually digging into it, named requires at least a minimum of 128. It then, as a result, issues fcntl(fd, FD_DUPFD, reserved), where reserved is the minimum value of 128 if the socket is determined to be a udp one. If fd's greater than 64 were truely invalid then duping the fd with the reserved range greater than 64 should have resulted in -1 with errno of EBADF just like select did. Besides, I believe the only deficiency here is that bind's configure isn't smart enough to auto correct the FD_SETSIZE when it detects it's under cygwin. Other utilities more than likely already do this part automatically for you during the configure stage... Anyhow, I did a private build using cygport and the patch attached in my previous response, and the resulting named (and utilities/libraries) are working quite well. Mohan -- 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