From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-01.nifty.com (conssluserg-01.nifty.com [210.131.2.80]) by sourceware.org (Postfix) with ESMTPS id 0F4BE385803E for ; Sat, 16 Apr 2022 09:17:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F4BE385803E 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 (ak044095.dynamic.ppp.asahi-net.or.jp [119.150.44.95]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 23G9GPRB024739; Sat, 16 Apr 2022 18:16:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 23G9GPRB024739 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1650100586; bh=booHsrTMETHxr3MPXHaidwaTnWfoEuUY7z0NYLCU3D8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TH7CnMmNX9e5We8egzamUtaZBZCZ6q4KsHYE0e8yWad+ivNB2T1TWRWpPDNSpRzrv etfvcz/UJQhpqc2FNBq+qmRTrVMAA3es+xVAAl3nLo8MuX7jYTEk6JW7lAwm2U28NI iG1auKBf48IVRyKWYge7+1OdbT3ZeHjt5yDswce1xCj6btmsE39+MfJSPZH4qBLwFd sVy1aLb7Esq0kPuKI/UQ/NCo8PaEvYoGTU+9rEcW5DYVnFMZUpBtr8D5YxQ54mGNh3 B6guYHsOnBlk9uBMk7pRMJxCe6fc3JESCRj6cNBbfTyJj7qPGufe8NPU2hyNxzGGVL Pd1nGlZXBbKnA== X-Nifty-SrcIP: [119.150.44.95] Date: Sat, 16 Apr 2022 18:16:50 +0900 From: Takashi Yano To: cygwin@cygwin.com Cc: Alexey Izbyshev Subject: Re: Deadlock when pressing Ctrl-C at startup of a native console application Message-Id: <20220416181650.cdb31ec9c75189724bf2f498@nifty.ne.jp> In-Reply-To: <355a1f23bf39b0670110a840075224a2@ispras.ru> References: <355a1f23bf39b0670110a840075224a2@ispras.ru> 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=-6.5 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: Sat, 16 Apr 2022 09:17:14 -0000 On Fri, 15 Apr 2022 21:09:05 +0300 Alexey Izbyshev wrote: > Hi, > > I've discovered that pressing Ctrl-C in a Cygwin ssh session running the > following command can cause a deadlock: > > $ while python -c ''; do :; done > > The exact native application doesn't matter here, e.g. "ping -n 1 > localhost >/dev/null" instead of "python -c ''" also "works". > > The deadlock is most easily triggered when CPU is fully loaded. It takes > no more than 20 tries on my machine to hit it (and when I first saw it, > it was on the first try). > > When the deadlock is triggered, there are conhost.exe and > cygwin-console-helper.exe processes, but there is no python. > > The exact process tree varies depending on Cygwin version. With the > vanilla 3.3.4 (the root is bash spawned by sshd): > > bash---bash-+-conhost.exe > `-cygwin-console-helper.exe > > With 20220301 snapshot > (https://cygwin.com/snapshots/x86/cygwin1-20220301.dll.xz), I get one of > the two following trees with an extra conhost.exe process: > > bash---bash-+-conhost.exe > |-conhost.exe > `-cygwin-console-helper.exe > > or > > bash---bash-+-conhost.exe > | `-cygwin-console-helper.exe > `-conhost.exe > > I was testing with 32-bit Cygwin on x64 Windows 10 21H2. Thanks for the report. I could reproduce the issue. I also found the current git master does not have this issue, while cygwin-3_3-branch does. Now I am identifying which patch solved the issue. One is obviously: https://cygwin.com/pipermail/cygwin-patches/2022q2/011870.html however, this was applied also for cygwin-3_3-branch. Therefore, another patch also should affect this issue. -- Takashi Yano