delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/26/09:11:12

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 <corinna-cygwin AT cygwin DOT com>
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
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
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

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019