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 C2E163858D39 for ; Thu, 3 Mar 2022 00:30:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C2E163858D39 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from Express5800-S70 (ak036016.dynamic.ppp.asahi-net.or.jp [119.150.36.16]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 2230TUR3019094; Thu, 3 Mar 2022 09:29:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 2230TUR3019094 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1646267370; bh=5iIgxSd8tdHZsYNJUr0/PhDQXtmFu6G6DTyvsAbNdo8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W7Jm/SUIcaAvFMxXwzuR3MDP7iPJwCYLFSXtY7eO5LQmvtltblXpvZ5jaY6H4kFZj Y6w71FPwn4vF260HXFwhB/GEfvyFCFiQ34dlJku1EH5ltb8hUVvqbA+S7KaZ784f3j qvpH/jYQPpbi9SGR4Eufxo8eQ920xRiILGdbe9azhzxaSpU3PhKmfzi/VKsKm82PDQ Pvdmt7jvX5FNO6ZrRKnALnlMz0se/FDvcdcoi0Ygf+L567ECVg1+b6IUJryw37HDS0 t572TMG09gQwazqZsOAKa3pvinWRqRzmGwht2QfM358WfKm0UASkh8vQWQrW3UJgpB 1ntr7xVwav85Q== X-Nifty-SrcIP: [119.150.36.16] Date: Thu, 3 Mar 2022 09:29:38 +0900 From: Takashi Yano To: cygwin@cygwin.com Cc: orgads@gmail.com, "Kaz Kylheku (Cygwin)" <743-406-3965@kylheku.com> Subject: Re: Typed characters are mis-ordered when CPU usage is high Message-Id: <20220303092938.7b19d0eb94d97d262f6d039e@nifty.ne.jp> In-Reply-To: <80097aaab50d22d359e9ce620beb3f97@mail.kylheku.com> References: <20220227235303.5d6239724ed83b145772134b@nifty.ne.jp> <80097aaab50d22d359e9ce620beb3f97@mail.kylheku.com> 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=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 03 Mar 2022 00:30:27 -0000 On Wed, 02 Mar 2022 12:28:47 -0800 "Kaz Kylheku wrote: > On 2022-02-27 06:53, Takashi Yano wrote: > > I think this is due to a bug which I recently fixed. > > https://cygwin.com/pipermail/cygwin-patches/2022q1/011791.html > > Was that upstreamed? Sorry to be a pain, but something in the > log message about the cause and the fix (not just the manifested > issue being addressed) would be good. > > Reversed characters might mess not only with the user's input, > but with input coming from terminal emulation, like escape > sequences, which may be a worse problem. What do you mean by upstream? The patch was applied the current cygwin git head (master) and cygwin-3_3-branch. This bug only affected to the key typed input (user key typing) in console (e.g. command prompt or Windows Termainal). If you mean output to the terminal by "input coming from terminal emulation", that is not affected. If you mean returned escape sequence such as 'ESC [ 24;1R' against 'ESC [6n', this should not be affected as well. The problem was that the console input buffer: https://docs.microsoft.com/en-us/windows/console/console-input-buffer could be messed up by the conflict between WriteConsoleInputW() called in console code (cons_master_thread()) and the keyboard events comes from user key typing. This has been fixed by checking the order of the input events in console input buffer after WriteConsoleInputW() and reordering that if the older events are placed after newer events. -- Takashi Yano