delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/04/16/05:05:57

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=n+dLSecflABRc7mDcRSN3Vysf+K3wuV99EO8Aht08wfxfhvw+nw34
khCBQR5EImJsH3LkD9epeZ0eDTqlcn91XrBB9QVOFeXCBibTW6WC00TtXW9GDesJ
4YfJtbw8U/666rEH6R/GWKMdji7J9Sg03lflJXueR+3x/u4+ysixLk=
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=cXSEmQBnBhfOk/SmO1jP511Jjzk=; b=qCMy7q7+SfQUX2/81Fw6BjBQ1q2b
mshzqOkl9vuFnAe9qhIRYAsRjbfm3Ex5Kv3jisHqRWla2i/bfujzEJqDQLBEQsOW
oIT/eDTeH3RvgIR48xHqRa+J2I0TPD4yJc8uZMq4G691s4GtWFvBOnI8zjDzLIJr
gZ3SN9BlLw+gEg8=
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=-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: Thu, 16 Apr 2015 11:05:33 +0200
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: <20150416090533.GB3657@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20150305125901 DOT GX3213 AT calimero DOT vinschen DOT de> <20150403130735 DOT d04e41875f7defd0e6c2d8d0 AT nifty DOT ne DOT jp> <20150403113226 DOT GP13285 AT calimero DOT vinschen DOT de> <20150404155520 DOT 8564347f1d42b3c709718aad AT nifty DOT ne DOT jp> <20150404084354 DOT GX13285 AT calimero DOT vinschen DOT de> <20150405205504 DOT cda3df2cc76f7bca7c3d21fb AT nifty DOT ne DOT jp> <20150407091113 DOT GB2819 AT calimero DOT vinschen DOT de> <20150413193100 DOT a393612bde79a4ae57b8c7d9 AT nifty DOT ne DOT jp> <20150414073456 DOT GY7343 AT calimero DOT vinschen DOT de> <20150416092618 DOT 9975c0e29b8703dbd8d4aa6a AT nifty DOT ne DOT jp>
MIME-Version: 1.0
In-Reply-To: <20150416092618.9975c0e29b8703dbd8d4aa6a@nifty.ne.jp>
User-Agent: Mutt/1.5.23 (2014-03-12)

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

Hi Takashi,

On Apr 16 09:26, Takashi Yano wrote:
> Hi Corinna,
>=20
> On Tue, 14 Apr 2015 09:34:56 +0200
> Corinna Vinschen <corinna-cygwin AT cygwin DOT com> wrote:
>=20
> > And the native client, not knowing what he's talking to, recognizes the
> > output stream as a normal named pipe, if it's looking for that info at
> > all.  Being native, it will use native Windows MSVCRT stdio calls.
> > Worse, as you can see in the behaviour of some native applications, the
> > MSVCRT isatty() call returns 0 for named pipes.
> >=20
> > If we have a Cygwin client, we can do all kinds of stuff on the slave
> > side, but as soon as we have a native client, only the master side of
> > the pty has any chance to do the right thing.  That's why I wrote that
> > we don't have the slave side under control.
> >=20
> > Therefore we should really move the OPOST code back to the master side.
> > I'm reluctant to just revert your patch, though, because I think you
> > know better how to fix the OPOST code to make it work correctly on the
> > master side.
>=20
> So OPOST processing should be in master side for native windows program.
> However, to solve the second problem I had pointed out in
> http://cygwin.com/ml/cygwin/2015-02/msg00929.html ,
> OPOST processing should be done on a timing when slave calls write().
>=20
> To solve this antinomy, I have made a patch attached.
>=20
> With this patch, new pipe is introduced to handle OPSOT-process separately
> between native windows program and cygwin program.
>=20
> Data from cygwin program is passed through the pipe newly introduced.
> In this case, process_opost_output() is called in fhandler_pty_slave::wri=
te().
> Master reads data, which is already applied OPOST process, from the
> new pipe.
>=20
> On the other hands, for native windows program, data is written into
> conventional pipe. Master forwarding thread, which is also newly
> introduced, reads conventional pipe and forward the data to the pipe
> newly introduced by calling process_opost_output(). This makes OPOST
> processing be done in master side.
>=20
> I have confirmed that the both problem is fixed with this patch.

Ok, but... this is a really big patch and it complicates the pty code
even more.  Is there really no other option as far as the TCSADRAIN
problem is concerned?

What strikes me as weird is that neither fhandler_pty_slave::tcsetattr
nor fhandler_pty_master::tcsetattr give a damn for the optional_actions
parameter.  They simply overwrite the tc settings.  So I'm wondering,
wouldn't it be possible to add code to the tcsetattr implementation
instead, so that TCSADRAIN/TCSAFLUSH are honored and than only have one
place for OPOST handling?

> By the way,
> I know that the names for the new pipe such as io_handle2, to_master2
> and output_handle2 are ugly enough. Are there more appropriate names?

What about renaming io_handle to io_handle_nat and io_handle2 to io_handle
or io_handle_cyg?


Thanks,
Corinna

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

--ZoaI/ZTpAVc4A5k6
Content-Type: application/pgp-signature

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

iQIcBAEBAgAGBQJVL3tdAAoJEPU2Bp2uRE+gpaYP/1+ZDR2FejyJr9Td/l00Ssyb
UkqbcsjTiaTzT6ixxE1QC9yv70sk2NwczUFA9kSfaHPBR1W6ELi7igBJ4KhRspci
YPqt32huNpbaNDmKXfjJ1KW0Md8ncU57By143Q7kV9x+AXOS6OBribPMbpv8dRVR
hF2lVVlVwVsVR4W4I1jQTj+muT4hOooVUTE1LWwDQRn4VPQlPpoAA70rbYdm2a0V
TLS6VcYyNA7p7QRw3d1Yt6gTxSqdrTmSbsVV1RaZ5wSZZsuN4MgcoZ2ruVXWD7se
eEb7ek841IgbVYow7wepdzMYxAwmX2uoS7hvzr5ogstFjbyadUVcKFlUS5eFNbmZ
UI82QpdD1wzDo8Ib8keXMA2J85jfN2LiD9o7x82G1SXhl/TREmrgZQme81aew2sk
/n2xqlUMs/lmhb6Bu26CqmPBsVSc06z6Om5Cnwgdnb07FfzOHyGGGUrmejPH6/wW
P+b7S1oWiXRF98w0xIAzxc2/xB5B4h9UFOrIOKRgyLnHqQMyIH0hhRKNPMcAr3wp
YFYt55ay6BIsbVi/jgnPhSgoOX439knERbdkq5dHqpu5oLCIMhvh5Sx8pY3fxEZ/
IatOB/3C78XJYULvj7qZole+t268kdJQjsQ1NYtbSQxHqVLLx4CNb25I8sjc+smD
6CwnbnuShKySB0lf6hgB
=C+Mm
-----END PGP SIGNATURE-----

--ZoaI/ZTpAVc4A5k6--

- Raw text -


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