delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/04/04:26:34

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 4 Aug 2011 10:25:45 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: odd socketpair() failure
Message-ID: <20110804082545.GA12783@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4E39D525 DOT 5070804 AT redhat DOT com>
MIME-Version: 1.0
In-Reply-To: <4E39D525.5070804@redhat.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
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 Aug  3 17:09, Eric Blake wrote:
> A while ago, I tested pipe() for EMFILE failures [1].  Well, I
> repeated those tests for socketpair() [2], and cygwin is once again
> the odd man out.
> [...]
> after fd 3199, open failed with errno 24 Too many open files
> try 1, socketpair returned -1 errno 24 Too many open files, fds -2 -3
> try 2, socketpair returned -1 errno 24 Too many open files, fds -2 -3
> try 3, socketpair returned -1 errno 24 Too many open files, fds -2 -3
> 
> But on Linux, try 3 succeeds.  Something in cygwin is not quite
> right on try 3 - the program explicitly freed two fd slots (0 and
> 3199), so it should have plenty of room to create the socketpair
> without hitting EMFILE.

The socketpair function forgot to free the descriptor slot of the first
socket if there was no room left for the second socket.  Fixed in CVS.


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