X-Recipient: archive-cygwin@delorie.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=RmIqkI4lP1wvJ+XdX71olMuCjD5b6OtEC7M5y0EJfE+mWMffimBK+
	fJKC5cVzREQpgapOyYnYD7dyaAXeMwFy7CwJ6LGNSQhSo7uiDCz+qwpZZoYXjC50
	j+UD6lTec46izZu9QrOOyy2Rs9vMccOo51m2xZqKEnCRHAQSNApjSs=
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=oD2cyJ3cFqfczScL0O0SCj0cClI=; b=Xtm09gT6dujAVDemNmF8cB8/m0Jy
	rhTrUGZ/AvE7BzMqv6I2nHgbgV1UH+eppZePNzDprae3P/1+1f+tuh8beTsvVwad
	z7tyRTP+yALlpr1mqhET2xLXKOKPhvYxyDwnioNpHLApA5XUX9Om/4ktNFXFVfH/
	FGVsoFfcXpWDKYE=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Fri, 3 Apr 2015 13:32:26 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin hangs up if several keys are typed during outputting a lot of texts.
Message-ID: <20150403113226.GP13285@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> <20150304121952.GL3213@calimero.vinschen.de> <20150304181857.GM3213@calimero.vinschen.de> <20150305202456.9ac4815a9d590145e15f7ae2@nifty.ne.jp> <20150305125901.GX3213@calimero.vinschen.de> <20150403130735.d04e41875f7defd0e6c2d8d0@nifty.ne.jp>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;	protocol="application/pgp-signature"; boundary="ixNtouB4hv1hrEz3"
Content-Disposition: inline
In-Reply-To: <20150403130735.d04e41875f7defd0e6c2d8d0@nifty.ne.jp>
User-Agent: Mutt/1.5.23 (2014-03-12)
Note-from-DJ: This may be spam

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

Hi Takashi,

On Apr  3 13:07, Takashi Yano wrote:
> On Thu, 5 Mar 2015 13:59:01 +0100
> Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
>=20
> > > One small thing to be improved is here:
> > >=20
> > > +      if (echo_cnt > 0
> > > +	  && ReadFile (echo_r, outbuf, MIN (rlen, echo_cnt), &n, NULL))
> > >=20
> > > echo_cnt returned by ::bytes_available() is actually
> > > not a number of bytes available in the pipe. This is
> > > because ::bytes_available() returns "nleft" instead
> > > of "navail" when "nleft" is non-zero.
> > >=20
> > > Therefore, "rlen" should be used here rather than
> > > "MIN (rlen, echo_cnt)".
> >=20
> > Thanks, done.  I applied the patch now with two additional changes for
> > better error handling.
>=20
> For the same reason, I propose the following patch.
>=20
> 2015-04-03  Takashi Yano  <takashi.yano@nifty.ne.jp>
>=20
> 	* fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of
> 	"readlen" not to use "bytes_in_pype" value directly.

Thanks, patch applied.

Btw., we have a regression in the latest PTY code in terms of some
native Windows tools.  I noticed this with `icacls':

With Cygwin 1.7.35:

  $ icacls xxx
  xxx VINSCHEN\corinna:(W,D,Rc,WDAC,WO,X,DC,RA)
      VINSCHEN\vinschen:(W,Rc,X,DC,RA)
      Everyone:(W,Rc,X,DC,RA)

  Successfully processed 1 files; Failed processing 0 files

With git HEAD:

  $ icacls xxx
  xxx VINSCHEN\corinna:(W,D,Rc,WDAC,WO,X,DC,RA)
						   VINSCHEN\vinschen:(W,Rc,X,DC,RA)
       Everyone:(W,Rc,X,DC,RA)

			      Successfully processed 1 files; Failed processing 0 files

This does not occur in a Windows console window, so it seems this has
been introduced by the PTY changes.

If you look into the output generated by icacls, you'll notice that it
only generates POSIXy LF line endings, not Windowsy CRLF.  The CRs
required to generate correct output are missing now for some reason, but
only for native, non-Cygwin clients.

Would you mind to have a look into this issue?


Thanks,
Corinna

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

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

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

iQIcBAEBAgAGBQJVHnpKAAoJEPU2Bp2uRE+gnxEQAJC4DHGSC0ozGyyDvucTYcnJ
fr/4e39HTTfj3hjk5hGGc98YeD6ZTGumgBpUTjCDilp63rzLvCkT+A72DP2vxdOt
Ke/KHCpFG8KVmu2HtX51EOQLe8ooP3tJh4sEDmhVyKCV7wsq1YODV0/cBKkOMugg
lc28r9CE/9cfYsfuBZ2wblEAS97n25crWP8rFWSZH6PgYZW4366W7m0PMxvO8YDH
mqbtt5u/VpHLYrNRrUoTCUGxkMUPn+gLxl9ONcnYLk0HryXeC89fXX9n9DiFLhRa
gwPPl0XVXInUGzxX0uSaZ1ZWxqwbup9Ue2prWlTnBF0oSAMBbkyXAfG1FD9fCiGH
MPYMbSYK97V5M66NFWnf/FsLL9NkRfyCjTsNM7C1n3u1ZQ0jumGAJ+NQ/ShEo2M4
tvk48KMuvwdFHioyb4yz5FykkiKeMFftkSULYAz6RZfuJUfPPSWrS2fAXzjlFPAu
c/znJ8h9tAhisyd6kjaWqW4ae38eukNMODcU0J5bUD7vOFZVw22edJHr24iEuYcH
s1BJCYXj7UERq9fp4RUfii2UXjAbSpJ+NaETgaStwk4gste4x4GZ4QbCSqtWBL/f
q5M9FV4gsiPCjmq/pHY1za9XApa4Dt2qLOHqqI5OQHBzDQvl5R8BUr3GnYlW1A2h
Em2pvZETQ69aiL51rzXk
=pgnX
-----END PGP SIGNATURE-----

--ixNtouB4hv1hrEz3--
