public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: mintty: Ctrl-Q does not work?
Date: Fri, 19 Oct 2012 15:00:00 -0000	[thread overview]
Message-ID: <20121019150037.GA17402@ednor.casa.cgf.cx> (raw)
In-Reply-To: <20121019121729.GW25877@calimero.vinschen.de>

On Fri, Oct 19, 2012 at 02:17:29PM +0200, Corinna Vinschen wrote:
>On Oct 19 12:26, Andy Koppe wrote:
>> On 13 October 2012 16:38, Christopher Faylor wrote:
>> > On Sat, Oct 06, 2012 at 05:48:44AM +0100, Andy Koppe wrote:
>> >>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.
>> 
>> Using snapshot 2012-10-16, I confirmed that Ctrl+S during a long cat
>> no longer freezes the terminal and that Ctrl+Q
>> 
>> However, I still see the deadlock described above when hitting any
>> other key that sends something, e.g. just Enter.
>
>Too bad.  Are you sure?  I tried really hard to get a deadlock and could
>not reproduce it anymore under W7.  My Enter key is still on paracetamol.

I can't duplicate it either.  I do notice that Cygwin doesn't work like
UNIX in that characters are still echoed after CTRL-S is hit.  That's
wrong but it looks like making it right will require major surgery.

Must.  Resist.  YA.  Pty.  Rewrite.

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

  reply	other threads:[~2012-10-19 15:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25 12:10 Helmut Karlowski
2012-09-25 13:32 ` Thomas Wolff
2012-09-25 15:41 ` Ryan Johnson
2012-10-06  4:48   ` Andy Koppe
2012-10-13 15:38     ` Christopher Faylor
2012-10-19 11:26       ` Andy Koppe
2012-10-19 12:17         ` Corinna Vinschen
2012-10-19 15:00           ` Christopher Faylor [this message]
2012-10-21  4:38             ` Andy Koppe
2012-10-21  5:44               ` Christopher Faylor
2012-10-28  6:24                 ` Andy Koppe
2012-10-28 17:17                   ` Helmut Karlowski
2012-10-28 17:32                     ` Christopher Faylor
2012-10-29 12:49                     ` Charles Stepp
2012-10-29 14:34                       ` Christopher Faylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121019150037.GA17402@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).