This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin hangs up if several keys are typed during outputting a lot of texts.
- From: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- To: cygwin at cygwin dot com
- Date: Mon, 2 Mar 2015 20:45:02 +0900
- Subject: Re: Cygwin hangs up if several keys are typed during outputting a lot of texts.
- Authentication-results: sourceware.org; auth=none
- References: <20150228144019 dot 0e4cfdb3a26bfac361b538e2 at nifty dot ne dot jp> <20150228140251 dot GA11124 at calimero dot vinschen dot de>
On Sat, 28 Feb 2015 15:02:51 +0100
Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
> Hmm, I can reproduce this even with stty -echo. The tty code is not
Some shells seem to re-enable echo when it goes back into prompt.
Please put both 'stty' and 'yes' in one command line, separating
them with semi-colon.
> exactly my domain, so I'm not sure at the moment where to look. I guess
> the locking strategy in the tty code is not robust enough. Did you have
> a look into the cygwin sources in the meantime, by any chance?
To tell the truth, I have looked into the source code.
I guess the mechanism of blocking is as follows.
1) Buffer of named pipe gets full-filled by a lot of data written
by slave side.
2) WriteFile() in fhandler_pty_master::doecho(), which is called
from master side by key input, is blocked because the buffer
is full.
3) If a handling to read from the pipe is in the same thread as
key input, the thread falls into deadlock.
To check buffer space before WriteFile() is one idea,
but it is not smart, I suppose...
--
Takashi Yano <takashi.yano@nifty.ne.jp>
--
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