From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by sourceware.org (Postfix) with ESMTPS id F0ADA3858418 for ; Thu, 23 Dec 2021 15:32:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F0ADA3858418 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-xf2c.google.com with SMTP id kc16so5508950qvb.3 for ; Thu, 23 Dec 2021 07:32:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vw5MuZg3VnX9YA+8LGjvyCBbuc7yUWnPx/s0+rvHYDo=; b=hkZtQEkuLeCuOBwE5VqMtXXUys9wv3CHeTD7i9VlVv25VTvVXL2pYkxFHe/hXnbDEa 5lcv3D3ytarSNcKUOTYJdbnxJWA5BB1o4kRdLvuRtH49ouWnn/23ZSvKH3jWPC/as1a5 /E4m7/abpXCLIXT1BMVnLc7wZ3pUEPi2vjmhDr6HXu9rtlC46dQjjZ6UgQwXTFcIprH8 xpA2S68pS+Covvg9ipO7a1HQ3cQEoyIn6gdecFir1eXr4tembSwy7SUBJGan8Is66m8M sXqIuqp7/Z/eWrxylnlxAECsvrPbE42OqVQYPA8NNM/RAcyOpWdfgWSKnEmuHZNb4WEm GPuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=vw5MuZg3VnX9YA+8LGjvyCBbuc7yUWnPx/s0+rvHYDo=; b=uu592bXLPRPjH1Zeyi7Hy6FiuW2DWHYpucukPfHKSKGtk9uuiviLaQF9IRvpext46N HhGSgpxN2Q+XrLclfkyqrGTjk9UsEUzsyGDALlskCy+dyoqDd0M+FrsJtRDn8gecb8ts RGwnyoLcmLPI7B6dUl/rYk2yYhtMHtvVAi6fHVIkuQroH4a81NKudCtvXZB/w20GM8r+ AlChliScJM/WqiZs4ki6pKLBOKbD2NoFBGislfc0Ul8hVXeIoJY09vLnIr2V11eSbQNe wzkD7Q5QQ7ST9YEA9E/RDag23YSas/1Ee/WA5b+hzwzoT5RYaoNucy/KoSsR/3QIHuSt +1Ng== X-Gm-Message-State: AOAM533nJwEfJp5zlzMkLocMwRzn+evUaRarXbm0O5izLXnKyYCFAfRJ VAOSXGz3VFUwzXhLlUkzModKCGZu3Gs= X-Google-Smtp-Source: ABdhPJxr6jaaP17s7Y6oanh3aX3zuAfmg1vq5C/cfJQGN+VdJROSJBzpaNjomjcTX3f6T2UvrOufXg== X-Received: by 2002:a05:6214:984:: with SMTP id dt4mr2081690qvb.120.1640273573032; Thu, 23 Dec 2021 07:32:53 -0800 (PST) Received: from office-nix (hlfxns018gw-134-41-172-106.dhcp-dynamic.fibreop.ns.bellaliant.net. [134.41.172.106]) by smtp.gmail.com with ESMTPSA id j20sm5133866qko.117.2021.12.23.07.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 07:32:52 -0800 (PST) From: David McFarland To: Takashi Yano Cc: cygwin-developers@cygwin.com Subject: Re: deadlock on console mutex in gdb References: <20211223054409.610242feb0e96199904b3c9e@nifty.ne.jp> <20211223182440.e37115a4493516aca7ed7873@nifty.ne.jp> Date: Thu, 23 Dec 2021 11:32:51 -0400 In-Reply-To: <20211223182440.e37115a4493516aca7ed7873@nifty.ne.jp> (Takashi Yano's message of "Thu, 23 Dec 2021 18:24:40 +0900") Message-ID: <87mtkribfg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2021 15:32:55 -0000 Takashi Yano 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.