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=ZVBW7OKAzzbHpbGhdMT6iFgTij8uBppdCJ/u7RFIWEIg2bubBmXnk g+rSf6+ixwP9A7XLOwpqv9iRZRsAOVxzrlcRAz7dUiwIr28WMSUOJUeZzQdFeSP3 HRFrOwMAhhdg7HH76RNm2ICsCX4v8u/PE0XD0Gs3AOReUK6bL1LI6Y= 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=XOYRFr7vPjGm9O/qcQ79O171ylc=; b=igwKpe0TuVwrJ8sy2fjYiWXmOz57 lidOeUtqqjh0aVCMf4cVvdr4zHLXHwAd80TqqJiuMDkBZJANyH2lWnLpmSW8XxY9 Yo3HIqsJjrqpzbXfNsfKZjkKZ2aSJUGeEVf8xjHk39BHF6SYRhjOtAvnpN7E4PRc 7VsWjPMN1V5wdhw= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 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: Wed, 4 Mar 2015 13:19:52 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT 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 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> <20150304203407 DOT 14008531b0fb63ad5c19a33f AT nifty DOT ne DOT 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) --VcZjVMblxkg0/8Ur Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 -----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--