deadlock on console mutex in gdb

David McFarland corngood@gmail.com
Thu Dec 23 15:32:51 GMT 2021


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.


More information about the Cygwin-developers mailing list