public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: David McFarland <corngood@gmail.com>
To: Takashi Yano <takashi.yano@nifty.ne.jp>
Cc: cygwin-developers@cygwin.com
Subject: Re: deadlock on console mutex in gdb
Date: Thu, 23 Dec 2021 11:32:51 -0400	[thread overview]
Message-ID: <87mtkribfg.fsf@gmail.com> (raw)
In-Reply-To: <20211223182440.e37115a4493516aca7ed7873@nifty.ne.jp> (Takashi Yano's message of "Thu, 23 Dec 2021 18:24:40 +0900")

Takashi Yano <takashi.yano@nifty.ne.jp> writes:

> I think there is no other way than not to wait mutex in the
> debugger process. If anyone have any other idea, please let
> me know.

I have a few thoughts:

I believe gdb currently just uses windows debugging APIs, so it doesn't
treat cygwin as an operating system. On other operating systems there
would be some mechanism to prevent kernel mutexes from deadlocking. It
obviously can't just wait for all syscalls to complete, but it must
avoid blocking kernel tasks that hold mutexes. Perhaps we could do
something similar on cygwin, but it would probably mean providing
cygwin-specific debugging APIs and support in gdb. I'd have to do some
more research into how this works on e.g. Linux.

Can we avoid using inter-process mutexes for this? What would you expect
to break if we just used a per-process mutex?

If we do need an inter-process mutex, perhaps we could have a daemon
process responsible for it? I think that would be a bit of a departure
for cygwin.

  reply	other threads:[~2021-12-23 15:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 15:26 David McFarland
2021-12-22 20:44 ` Takashi Yano
2021-12-22 22:17   ` David McFarland
2021-12-23  9:24     ` Takashi Yano
2021-12-23 15:32       ` David McFarland [this message]
2021-12-23 19:28         ` David McFarland
2021-12-26 15:25           ` David McFarland
2022-01-13 11:09           ` Takashi Yano
2022-01-13 10:56         ` Takashi Yano

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=87mtkribfg.fsf@gmail.com \
    --to=corngood@gmail.com \
    --cc=cygwin-developers@cygwin.com \
    --cc=takashi.yano@nifty.ne.jp \
    /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).