public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Alexey Izbyshev <izbyshev@ispras.ru>
To: cygwin@cygwin.com
Subject: Deadlock when pressing Ctrl-C at startup of a native console application
Date: Fri, 15 Apr 2022 21:09:05 +0300	[thread overview]
Message-ID: <355a1f23bf39b0670110a840075224a2@ispras.ru> (raw)

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


             reply	other threads:[~2022-04-15 18:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 18:09 Alexey Izbyshev [this message]
2022-04-16  9:16 ` Takashi Yano
2022-04-18 12:48   ` Takashi Yano
2022-04-18 15:07     ` Alexey Izbyshev

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=355a1f23bf39b0670110a840075224a2@ispras.ru \
    --to=izbyshev@ispras.ru \
    --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).