From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16759 invoked by alias); 4 Mar 2015 12:19:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 16750 invoked by uid 89); 4 Mar 2015 12:19:55 -0000 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 Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Mar 2015 12:19:54 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 7B0ABA80A3B; Wed, 4 Mar 2015 13:19:52 +0100 (CET) Date: Wed, 04 Mar 2015 12:43:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Cygwin hangs up if several keys are typed during outputting a lot of texts. Message-ID: <20150304121952.GL3213@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20150228144019.0e4cfdb3a26bfac361b538e2@nifty.ne.jp> <20150228140251.GA11124@calimero.vinschen.de> <20150302204502.39b3e03ad5084b0b5add5d10@nifty.ne.jp> <20150302144426.GK3213@calimero.vinschen.de> <20150304203407.14008531b0fb63ad5c19a33f@nifty.ne.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VcZjVMblxkg0/8Ur" Content-Disposition: inline In-Reply-To: <20150304203407.14008531b0fb63ad5c19a33f@nifty.ne.jp> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-03/txt/msg00046.txt.bz2 --VcZjVMblxkg0/8Ur Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2060 On Mar 4 20:34, Takashi Yano wrote: > On Mon, 2 Mar 2015 15:44:26 +0100 > Corinna Vinschen wrote: >=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::doec= ho > > and fhandler_pty_slave::write to overlapped I/O and made sure to wait > > 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. >=20 > Hmm. >=20 > To confirm my assumption, I have modified the TTY code > for testing. The modification is shown in an attached > diff-file against current CVS version. (Note that this > patch is not for fixing the problem. It is for just a > testing.) >=20 > With this modification, half of buffer is kept empty > for fhandler_pty_master::doecho(). I assumed the blocking > could be avoided because buffer is always free. >=20 > As a result of the test, it has become clear that this > modification conceals the problem. This means the problem > is closely related to occupancy of buffer. >=20 > Now, I suppose the cause has been clarified. So we have > to work out a solution. How can we resolve this problem? I'm not sure. I still have to look deeper into that. Locally I treid to woraround this problem by calling WriteFile overlapped without waiting for the result, but even that doesn't work. Hmm, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --VcZjVMblxkg0/8Ur Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJU9vhoAAoJEPU2Bp2uRE+gMWoP/ivGP1sFOg3v1Gc6vo8Nf7Lp kXb/GcYkpae2+hEGdp3MK4OqRjejlxFAqUlbRGcixsA5JhZqyfn6v0VVnF8KIJ6f LqWB/z53HRA12UFjFP1xcKzVAVUgG3Dh6+LY+cbrRIwvqE4S1DDAsZ3+76IWN+ov PnQjKgeod+KKEDY816SyzRH100s1b66RVLNFkF9syOYDqYayWEdeIe1ABGniBR7p ankcgqjKJq+ApXUrllESGErOXJtkewptneavP1p+wueyv+44z1xGOsTwoTPfOQK0 PX9ihXKVm2DX09NOWu2gd/hCF6gZRuensDOLTsDAQFWBPcz1SzrXC1ffPA0Sx+nM gxP3x7CNcXsVWQkl/c0LsFqJis2+QmRrU3t+dPam4p419dabRUJSeLpPV4pqNHJJ /Z5Xw/AQL3sOwB3d3/4tJo4mRsxOtlN91Gv/W4ZXfhX3Pi6e6WpLiZZRXu0rGV4h CJuRIdy7Rcu39x/sdVdzOGI3RiUJUVBstPGqMf6hWlA4dEoazEYpeE/8p+8ADj6M /5++BeTcU9NMkV2oihkFUWjFlDGhEWZ4GZn9T3HYPVDwKGVNFQiOwbNjEdidDS6E 84whlpGJxOHktO6d24+Pu0AeRkDGwM0WGuFwCJS1GwhSfZn0s8HJE3s0tRcKAZSH O8YiUciuvcPbOY4cu9HN =DOTX -----END PGP SIGNATURE----- --VcZjVMblxkg0/8Ur--