X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,TW_CG X-Spam-Check-By: sourceware.org X-Mail-Handler: Dyn Standard SMTP by Dyn X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/It0K63PrmucIqpVucTJVq Date: Sat, 13 Oct 2012 11:38:31 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: mintty: Ctrl-Q does not work? Message-ID: <20121013153831.GA839@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <5061B263 DOT 4090704 AT cs DOT utoronto DOT ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Sat, Oct 06, 2012 at 05:48:44AM +0100, Andy Koppe wrote: >On 25 September 2012 14:32, Ryan Johnson wrote: >> On 25/09/2012 6:05 AM, Helmut Karlowski wrote: >>> >>> I type >>> >>> cat [some long ascii-file] >>> >>> then Ctrl-S (output stops), then Ctrl-Q (terminal hangs, can only be >>> terminated by closing the window). >>> >>> Using minty 1.1.2 and 1.7.16(0.262/5/3) 2012-07-20 22:55 i686 Cygwin >>> >>> Can anybody reproduce this? >>> >> Confirmed with mintty 1.1.1 and the same version of cygwin (w7-64). FWIW, >> doing it with `find .' rather than `cat' works fine. > >The issue isn't specific to any of mintty, cat or Ctrl+S; for example, >I've managed to reproduce it with xterm, hexdump, and just hitting >Enter. Any other key that sends a keycode will do too. Ctrl+Q isn't >needed for the freeze to happen. In xterm I've even managed it with >find, by hitting Enter repeatedly. > >If you then look at the situation in ps, you'll see something like this: > >O 3396 1 3396 1472 ? 1004 05:11:07 /usr/bin/xterm >O 3528 4460 3528 528 pty3 1004 05:25:01 /usr/bin/cat > >The interesting bit there is the two 'O's in the first column, which >means both processes are waiting to output. I think what's happening >is that both of them are trying to write to their side of the >underlying pty device, but that those writes are blocking until data >is read from the other side of the pty. Result: deadlock. If the cat >is killed (possibly with -9, because of its nine lives), the terminal >happily continues on its way. > >So why doesn't this happen more often? Not sure. The speed difference >between the client process output and the terminal seems to play a >role here. I can only guess that the issue occurs if a buffer in the >pty's slave->master pipe overflows and something is written to the >master->slave pipe at the same time (which is unbuffered?). > >I don't understand the pty implementation enough to verify any of >that, so cgf would need to comment further. Note besides: I couldn't >make this deadlock happen on Ubuntu. This should work in the latest snapshot. I added a polling kludge for 1.7.17 while I mull over the best way to handle this. cgf -- 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