Deadlock when pressing Ctrl-C at startup of a native console application

Alexey Izbyshev izbyshev@ispras.ru
Fri Apr 15 18:09:05 GMT 2022


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,
Alexey



More information about the Cygwin mailing list