Race condition hangs on multiple mintty/tcsh? Brad Wetmore

Thomas Wolff towo@towo.net
Thu Aug 6 18:48:35 GMT 2020


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.


More information about the Cygwin mailing list