public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brad Wetmore <bradfordwetmore@hotmail.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Race condition hangs on multiple mintty/tcsh? Brad Wetmore
Date: Thu, 6 Aug 2020 18:07:45 +0000	[thread overview]
Message-ID: <BYAPR07MB59421E727E0CC742E4A4DA41B6480@BYAPR07MB5942.namprd07.prod.outlook.com> (raw)
In-Reply-To: <BYAPR07MB59428411CD00101EF02400B4B64D0@BYAPR07MB5942.namprd07.prod.outlook.com>

[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.

Brad


  parent reply	other threads:[~2020-08-06 18:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 22:13 Brad Wetmore
2020-08-04 10:02 ` Thomas Wolff
2020-08-05 22:56   ` Thomas Wolff
2020-08-05 23:23     ` Kevin Schnitzius
2020-08-06 11:46       ` Thomas Wolff
2020-08-06 13:31         ` Thomas Wolff
2020-08-06 14:26           ` Corinna Vinschen
2020-08-06 14:33             ` Thomas Wolff
2020-08-07 15:34               ` Takashi Yano
2020-08-11  4:59           ` Takashi Yano
2020-08-11  9:37             ` Corinna Vinschen
2020-08-11 10:02               ` Takashi Yano
2020-08-11 10:30                 ` Corinna Vinschen
2020-08-11 17:37                   ` Thomas Wolff
2020-08-12 20:27                     ` Thomas Wolff
2020-08-06 18:07 ` Brad Wetmore [this message]
2020-08-06 18:48   ` Thomas Wolff
2020-08-06 19:25   ` Brad Wetmore
2020-08-13  3:08     ` Brad Wetmore
2020-08-25 18:45       ` Brad Wetmore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR07MB59421E727E0CC742E4A4DA41B6480@BYAPR07MB5942.namprd07.prod.outlook.com \
    --to=bradfordwetmore@hotmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).