delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/03/02/09:51:00

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=M6RDWh70BWIIDQ63KxZYZGqoakSVOnjMdeW0Ld75rQIoUoYp62gu1
/3QrlGpzajkWNb4ZpUIfcVQLHyQiPYIi3d+866UQRMnKDKFBcxgE/xUfjA+Dpbdv
rQOzNH6OTSHfWxAgqKHiwdyvAP6oYkcFGiPhUw6tJu/e2f5FHstUoE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=iHA7sUSGrhn1TzXgw4A++Sb0fRA=; b=aznCMtz/XYUJa/TkH+KeI11hC4mB
YxRw9jYRzY/ZSdyB1AXca7hv3o+1i049aiYKHrMa0kUObFEWA/KIpVS1P01u+BW5
m6ggwgGZYyvLkiJ2IpMCakDMGR6h6TKqcdmyI+ekgO4anLGNoaLVp748QZfJ5Yjl
cLR50f2dqJJ4VPc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=AWL,BAYES_00,UNSUBSCRIBE_BODY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Mon, 2 Mar 2015 15:50:39 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin hangs up if several keys are typed during outputting a lot of texts.
Message-ID: <20150302145039.GL3213@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20150228144019 DOT 0e4cfdb3a26bfac361b538e2 AT nifty DOT ne DOT jp> <20150228140251 DOT GA11124 AT calimero DOT vinschen DOT de> <20150302204502 DOT 39b3e03ad5084b0b5add5d10 AT nifty DOT ne DOT jp> <20150302144426 DOT GK3213 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20150302144426.GK3213@calimero.vinschen.de>
User-Agent: Mutt/1.5.23 (2014-03-12)

--XjbSsFHOHxvQpKib
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mar  2 15:44, Corinna Vinschen wrote:
> Hi Takashi,
>=20
> On Mar  2 20:45, Takashi Yano wrote:
> > On Sat, 28 Feb 2015 15:02:51 +0100
> > Corinna Vinschen <corinna-cygwin AT cygwin DOT com> wrote:
> >=20
> > > Hmm, I can reproduce this even with stty -echo.  The tty code is not
> >=20
> > 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.
>=20
> Uh, ok, I didn't realize that.
>=20
> > > exactly my domain, so I'm not sure at the moment where to look.  I gu=
ess
> > > the locking strategy in the tty code is not robust enough.  Did you h=
ave
> > > a look into the cygwin sources in the meantime, by any chance?
> >=20
> > To tell the truth, I have looked into the source code.
> > I guess the mechanism of blocking is as follows.
> >=20
> > 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.
> >=20
> > To check buffer space before WriteFile() is one idea,
> > but it is not smart, I suppose...
>=20
> I think that's not it.  For testing I added code to convert the
> WriteFile calls in fhandler_pty_slave::write, fhandler_pty_master::doecho
> and fhandler_pty_slave::write to overlapped I/O and made sure to wait

Copy/paste didn't quite work as I expected.  Substitute one of these
fhandler_pty_slave::write with fhandler_pty_master::accept_input.

> for the result after the output mutex has been released.
>=20
> This change has no effect at all.  Looks like this needs some more
> digging.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--XjbSsFHOHxvQpKib
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJU9Hi/AAoJEPU2Bp2uRE+gKu8P/jT4xqYSqRu5mOpvs/jpkf7n
D3SlehPEdS6hABxawBGK+HQi4gYwzBdKMCjnCaPe9/VtVaKEIIKQt/JohSCeCjWu
q2LeJFbmkSaKErDrN+VQK4SHwOhynd7pFnsv3CSYnAn45+tMtmM7qPzSpXY1hlIX
VcD1e9MvKZE//RTN5/uCRaZXsb51Wk7Xrut1xz5cZ/tFfX6su0QKPaZa3+yXFigF
KojXqOvkIAGfMQYE6wrJHaYq5K1W4YCatPJoPN4yrlbhH3KNC6gUyqi9wFFO4xGd
PIuBpxwkyKXNar3uDkhhTZQA2G0sSTWY0uH4ynsz8G1fFZGYjCVe1KpzlYKDbatO
HV88vmsV8eL848Dk8AXONmCyhFnWLHhvBTEAJ2lDQDyPLqYfOokjHHP54ZCVF2Um
nbVZ9byY+xREbXMO0NmPdUznBS8L+7nETUFeaU/nEESep6jG1ORhHp/gy4nDM+BX
KLXLhSBaLpTeS0CDFKyhVZtfnqQvF2hJwc6pekCkVTmbM0t1e6WoFDveLsKS4EkM
KAApm0LzBF64pzitf0Cu0U6tztxjO82ysxKD7KxMkeJlDpYsRKmRWM7gvRNqAMoK
aOEY9X8VMuwCKRMU9dnM9MWYAzbYG0An7jlItoQWKzIAAu3nj7z9QJVCq4h1KuKy
duhnpIzULWfbveafUK75
=t2jl
-----END PGP SIGNATURE-----

--XjbSsFHOHxvQpKib--

- Raw text -


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