X-Spam-Check-By: sourceware.org Date: Thu, 23 Feb 2006 16:59:35 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Shells hang during script execution Message-ID: <20060223215935.GC20944@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk 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 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/