X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 30 Jun 2011 11:38:25 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: bug in pipe() and pipe2() Message-ID: <20110630093825.GC9552@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4E0B9959 DOT 6060903 AT redhat DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4E0B9959.6060903@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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 Jun 29 15:30, Eric Blake wrote: > I was testing the behavior when pipe() fails, in order to propose an > update to POSIX wording: http://austingroupbugs.net/view.php?id=467 > > However, cygwin's pipe implementation dumps core when it runs out of > fds, [...] > Expected behavior is EMFILE and fd unchanged, after however many > iterations it takes to reach the ulimit on max fd. The problem is that Cygwin uses a placement new operator to allocate new fhandlers. This type of new operator calls the constructor even if the placement pointer is NULL. This in turn crashes in a rather obvious way. Since we need the placement new for fhandlers to make sure they are allocated on the cygheap, and since there is no such operator which only calls the constructor, I only see a very ugly workaround for this problem. I checked it in, together with two more fixes to avoid a crash. If somebody has a better solution, feel free to mention it. Thanks for the report, 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