From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-06.nifty.com (conssluserg-06.nifty.com [210.131.2.91]) by sourceware.org (Postfix) with ESMTPS id 09DA33851C0C for ; Mon, 1 Jun 2020 10:47:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 09DA33851C0C Received: from Express5800-S70 (v038192.dynamic.ppp.asahi-net.or.jp [124.155.38.192]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 051AlE62003431; Mon, 1 Jun 2020 19:47:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 051AlE62003431 X-Nifty-SrcIP: [124.155.38.192] Date: Mon, 1 Jun 2020 19:47:32 +0900 From: Takashi Yano To: cygwin@cygwin.com Cc: Andrew Ng Subject: Re: Repeated input in PTY with SSH when a native process runs a Cygwin process that consumes input Message-Id: <20200601194732.f1d0b3f1dbac9eb767d5084a@nifty.ne.jp> In-Reply-To: References: <20200531010628.da3864bdc895a02b768bb694@nifty.ne.jp> <20200531180439.3f6a13db1ffa6ed1df39959a@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2020 10:47:53 -0000 On Sun, 31 May 2020 13:00:51 +0100 Andrew Ng wrote: > > The developers snapshot, in which the issue has been fixed, > > is ready. Could you please test? > > Thanks for the fast response. > > I have tested the snapshot and can confirm that it fixes the issue. I > have also applied the same fix to MSYS2 and confirmed the issue is > fixed there too. Thanks for testing. > I did take a look at the code when I came across this issue and I > noticed a few things that looked a bit odd. I noticed that the > following functions appear to make use of rabuf () without > consideration for raixget (): > > fhandler_termios::eat_readahead > fhandler_pty_master::accept_input > fhandler_pty_master::transfer_input_to_pcon > > Also fhandler_pty_slave::eat_readahead does 'eols' processing without > any guard on is_line_input (), which seems to differ from the code > pattern seen elsewhere. > > I don't know if these are important, but thought I should mention > them, just in case. Thank you for your advice. I will check if these can cause any problem. As for pty master, get_readahead() is not used at all, so raixget() is always 0. So pty master code does not cause problem. However, it is certainly dangerous. I will consider how these should be. -- Takashi Yano