X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 26 May 2010 15:11:00 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: pty infinite master control thread spawning problem Message-ID: <20100526131100.GJ10652@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4BF2A0A9 DOT 5070201 AT gmail DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4BF2A0A9.5070201@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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 Hi Dave, On May 18 15:14, Dave Korn wrote: > > Hi, > > I'm having trouble with the latest changes to the pty control code. In my > case they manifest when I run parallel "make -j check" on GCC; after a minute > or two all the expect processes end up spinning CPU and everything grinds to a > halt. > [...] > - 32 threads all stuck in WFSO with no useful backtrace, and one that is > frantically looping in cygthread::callfunc() at this point: > > if (issimplestub) > > { > > /* Wait for main thread to assign 'h' */ > > while (!h) > > yield (); > > ... with "h" never getting set. > > The attached testcase demonstrates the underlying problem. I applied a patch to CVS. It worked for me, but while testing I encountered a handle leak in your testcase and, naturally, I thought it's my code. After some tinkering it turned out that your parent process neglects to wait for the child process. Adding int status; waitpid (child_pid, &status, 0); to the parent code removed the handle leak. Please test the change in Cygwin if it fixes the original problem for you. Thanks for the report and, especially, the testcase, 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