delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/04/04/19:04:18

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sat, 4 Apr 2009 20:03:48 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: TTY write deadlock
Message-ID: <20090405000347.GA32495@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <c1ed4c490904041511h32bea4e0k84949ebd1ce6f57b AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <c1ed4c490904041511h32bea4e0k84949ebd1ce6f57b@mail.gmail.com>
User-Agent: Mutt/1.5.16 (2007-06-09)
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

On Sat, Apr 04, 2009 at 03:11:06PM -0700, Josh Stone wrote:
>Hi,
>
>I've discovered a deadlock in Cygwin which is pretty easy to
>reproduce.?? This seems to happen on all of the console windows I can
>find, except for running in a normal cmd.exe.  All of these are
>affected though: xterm, rxvt, mintty, puttycyg+cthelper, and putty
>localhost -> cygwin sshd.
>
>To reproduce, run a command that produces a lot of output -- "man -P
>cat bash" works well.  While it's thinking about formatting that, just
>start mashing the keyboard.  When it starts writing out the manpage
>while you're still mashing keys, it will lock up (100% of the time for
>me).  You can kill the (Schr??dinger???s) cat and life will be ok again.
>
>I did some debugging and found that the terminal was stuck on
>acquire_output_mutex in fhandler_pty_master::doecho.  The cat process
>had fhandler_tty_slave::write in its backtrace, so it was holding the
>write mutex.  The cat won't release the mutex until its data is read,
>but the terminal won't read until after it acquires the mutex and
>finishes doecho.
>
>This is on cygwin-1.7.0-45, but I can reproduce it on the 1.5 series
>too.  And since it happens on so many terminals and even sshd, I don't
>think we can say it's the application's fault.  I can't reproduce it
>with a command like "man bash | cat" though, probably because the
>difference in line buffering makes the race harder to hit.
>
>I'm happy to help more with debugging, or I'll even try to write a
>patch if someone can suggest a good way to resolve this deadlock...

I can duplicate this.  I'll look into fixing it ASAP.

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/

- Raw text -


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