From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by sourceware.org (Postfix) with ESMTPS id 477923857C58 for ; Thu, 6 Aug 2020 18:48:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 477923857C58 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=towo.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo@towo.net Received: from [192.168.178.45] ([95.90.245.244]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M5wTt-1k6m9V3InD-007TlK for ; Thu, 06 Aug 2020 20:48:38 +0200 Subject: Re: Race condition hangs on multiple mintty/tcsh? Brad Wetmore To: cygwin@cygwin.com References: From: Thomas Wolff X-Tagtoolbar-Keys: D20200806204835263 Message-ID: <97552ff1-8aca-cbd0-db22-d59c381ed6c6@towo.net> Date: Thu, 6 Aug 2020 20:48:35 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:Z6Xvw+Rv5X8AoVTFnIwSHXNsHaIMGbVpxyjJ+bbGr3d2mbfGpvC 8tMWr065NvXOa5WpCO2qh7z4R4QvMINg26ZpMnPvMLTax3tNnJB9VmBagN3S/Pj1GyYWIZx g3hZsN8XV6bzPDLYL+39QsZylND0jRpdFSd2j+P9eqRKOxXHRMAhov9ibhWJEhyxa+hPut6 CqPSzBWfBKy6gnrU1qblw== X-UI-Out-Filterresults: notjunk:1;V03:K0:4o3qttjDsAo=:VvBSM5c+8/WvCugFIIZGw1 PqGT42Zjnea7m73KBsBOE9xShW6EdlqFrxa1Dbe34B5GL0AEo3KT/JH+412jjfpDzYPvbN1yy +DWfriE0zhI/SFIXPhDm/XnA2UII9CNXsWQLZpfDiWDFci/jwCDGDB5mhtAIe2RxyU5jI8oK9 erbWxzTOZK8uOS7DQ0S3+u+9jMILaVD9jv5QJqzWk4+SzvLJMAG2htBz8KCnuNd9EpKF+iR68 WjfSRS45mDHzyYGhm4lRzJdoSKD3846Q0Z+CqnAfhBuL38GZGfLhPwZijdlQEtpaUmAeS3VEE EjTL+clPom0lZ98N1UWj9AWelspd0QilElI2ofjtAA3M+LUnlUgQXAdRjqnHO8KrhJPtDDmQX IKAtyRqIIHO+xVF6aQ1IVTYgJY+Rv3DxC03FuIRIkRy5eqdMW5dfFwwNo9eGtpU/WuyduwSOx 1HuiGUINyK/leXMm0KjV9dov83J47m7X9s2/EgpnCCRl+H/iRpfHB5h5h58RmBWo67TjdFQX3 bRfmRiI8naZp1Ah0qvzgqw+Jt7m5UkhrjzpI6qLHzfemRo14zbSrZbihD7tem1s+Pbf7ZRQOZ J07Jq8fNuSJ/jW8ekUbweC7mwCnKAsit5iERXMnDU3TnDL5DpyrEvS1xd8IOwADNMeTX+eYxJ xit+vb8lNmn8Yn6kWDcvJafHGocdKcGuEFo7BiLhsnNNniazL4g31QNARCh1vF6yDHSW1kbDx Vdm3EVcIYl76/rjpuxB/qS2nT37fLut6PUclPVTYuVLIDiAY3ZLTaOm2lZUbhA3vql8i6yWAq Uiy6Xfn7QTaN5bu/8Ezlw5IbkhS3/p7r/psuzYv2Xj/+J+PS9tfBIHt8XqHFi0d6I2zKPHm X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham 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: Thu, 06 Aug 2020 18:48:42 -0000 Am 06.08.2020 um 20:07 schrieb Brad Wetmore via Cygwin: > [I apologize if this doesn't thread correctly: I've been getting the digest, and can't respond directly. And I have no idea how my name ended up in the Subject line: Rookie Move!] > > More debug information, and a workaround/solution: > > I am running: > > Windows 10 Version 1909, fully patched. > Cygwin v3.1.6-1 > Openssh v8.3p1-1 > mintty v3.2.0-1 > tcsh v6.22.02-1 > > The issue seems to be a race condition setting up ssh-agent, and then immediately starting up the the mintty/tcsh terminals. My guess is that something in ssh-agent is not fully setup yet, and is causing read hiccups in mintty. > > My startup script looks like: > > #!/bin/sh > > if [ -z "$SSH_AGENT_PID" ] ; then > echo "Starting ssh-agent" > eval $(ssh-agent) > ssh-add > #sleep 3 > fi > > C:/cygwin64/bin/mintty.exe -i /usr/share/mintty/icon/wsl.ico \ > --position 0,0 --size 80x24 --fg black --bg white /bin/tcsh & > #sleep 1 > ...9 more invocations deleted... > > Without the sleep 3 after starting ssh-agent, I see one of three conditions: > > 1. The mintty window is created, but immediately crashes printing a dozen or so "Use "exit" to leave tcsh" before it does. At least that I think it says, it happens fast! ;) > > 2. The mintty window is created, and is ready for input. On the first keypress, it prints a dozen or so "Use "exit" to leave tcsh" and crashes. > > 3. The mintty window is created, and hangs. No prompt. > > I get conditions #1/2 when I don't pause between mintty invocations. > I get condition #2 when I pause for 1 second between mintty invocations. > > If I pause for 3 seconds after starting ssh-agent, then everything works as expected. > > Note this issue occurs only during the first setup of 10 terminals. Running it again does not tickle the issue, probably because ssh-agent is fully up. > > Hope this helps. You had previously reported the issue without ssh involved. Does this make it reproducible more often? Otherwise let's not make things unnecessarily complicated.