X-Spam-Check-By: sourceware.org
Date: Thu, 23 Feb 2006 16:59:35 -0500
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Shells hang during script execution
Message-ID: <20060223215935.GC20944@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <A7E7241463A43B46B90F37197A667AE3055186@STEELPO.steeleye.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <A7E7241463A43B46B90F37197A667AE3055186@STEELPO.steeleye.com>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Thu, Feb 23, 2006 at 04:35:12PM -0500, Ernie Coskrey wrote:
>Here's a description of a second hang condition we were encountering, along with a patch for it.
>
>
>The application (pdksh in this case) does a read on a pipe, which eventually calls pipe.cc fhandler_pipe::read in Thread 1.  This creates a new cygthread with "read_pipe()" as the function.  Then it calls th->detach(read_state).
>
>When the hang occurs, the new thread gets terminated early, before
>cygthread::stub() can call "callfunc()".  You see the error message
>"erroneous thread activation".  I'm not sure what's causing the thread
>to fail activation, but the result is, the read_state semaphore never
>gets signalled.

Sorry but this is another band-aid around a problem.  The real problem
is that the code shouldn't get into the state that you are describing.
That's why cygwin prints an error message - it is a serious problem.
Making the code deal gracefully with a problem like this isn't going
to solve the underlying issue.

If you can figure out what's causing the erroneous thread activation
then that will be the real culprit.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

