From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: fix "set scheduler-locking" thread exit hang
Date: Thu, 11 Nov 2021 18:09:18 +0000 [thread overview]
Message-ID: <223ea569-d16b-cfd6-c494-1e4a3349fecf@palves.net> (raw)
In-Reply-To: <20211108214921.373638-1-simon.marchi@efficios.com>
On 2021-11-08 21:49, Simon Marchi via Gdb-patches wrote:
> The problem is in handle_no_resumed: we check if some other thread is
> actually resumed, to see if we should ignore that event (see comments in
> that function for more info). If this condition is true:
>
> (thread->executing () || thread->has_pending_waitstatus ())
>
> ... then we ignore the event. The problem is that there are some non-resumed
> threads with a pending event, which makes us ignore the event. But these
> threads are not resumed, so we end up waiting while nothing executes, hence
> waiting for ever.
"There are some non-resumed" ... "But these are not resumed".
The first "non-resumed" should be "non-executing", I believe.
>
> My first fix was to change the condition to:
>
> (thread->executing ()
> || (thread->resumed () && thread->has_pending_waitstatus ()))
>
> ... but then it occured to me that we could simply check for:
>
> (thread->resumed ())
>
> Since "executing" implies "resumed", checking simply for "resumed"
> covers threads that are resumed and executing, as well as threads that
> are resumed with a pending status, which is what we want.
OK.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2021-11-11 18:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 21:49 Simon Marchi via Gdb-patches
2021-11-11 18:09 ` Pedro Alves [this message]
2021-11-11 18:33 ` Simon Marchi via Gdb-patches
2021-11-11 19:04 ` Pedro Alves
2021-11-11 19:14 ` Simon Marchi via Gdb-patches
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=223ea569-d16b-cfd6-c494-1e4a3349fecf@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.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