From: Pedro Alves <pedro@palves.net>
To: Luis Machado <luis.machado@linaro.org>,
Tom de Vries <tdevries@suse.de>,
gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Fix gdb.threads/killed-outside.exp with -m32
Date: Tue, 13 Apr 2021 18:50:17 +0100 [thread overview]
Message-ID: <5faa429c-6d19-cb46-73c8-69ed2c016f69@palves.net> (raw)
In-Reply-To: <22f86bac-97f8-f4c2-404e-636ca279fb74@linaro.org>
On 13/04/21 16:51, Luis Machado wrote:
> On 4/13/21 11:45 AM, Pedro Alves wrote:
>> On 13/04/21 14:33, Luis Machado wrote:
>>>
>>> Forcing scheduler-locking to on made the output consistent for both cases, but I was left wondering if enabling scheduler-locking would cause the bug to not be reproducible anymore.
>>
>> Yeah, no. That would just paper over problems. GDB should cope with threads disappearing beneath it, as they're resumed, stopped, etc. Forcing scheduler-locking just
>> means you're only resuming one thread instead of many, and thus reducing the chances of some GDB issue triggering. Wouldn't be much different from making the testcase
>> be single-threaded.
>
> Right. The non-deterministic nature of the output makes it harder to find a reliable pattern to match.
>
> There seems to be a couple issues at play here. One is the non-deterministic ordering of thread-related outputs, which is expected and we can't do much about it. Though I'd expect a thread exit notification to always show up, and not be swallowed by GDB.
>
> The other is the non-deterministic position of the gdb prompt, even for all-stop mode. Sometimes it shows up before GDB gets a chance to output other messages, like so:
>
> Executing on target: kill -9 3742839 (timeout = 300)
> spawn -ignore SIGHUP kill -9 3742839^M
> continue^M
> Continuing.^M
> Unable to fetch general registers.: No such process.^M
> (gdb) [Thread 0xfffff7e281e0 (LWP 3742842) exited]^M
> ^M
> Program terminated with signal SIGKILL, Killed.^M
> The program no longer exists.^M
> FAIL: gdb.threads/killed-outside.exp: prompt after first continue (timeout)
>
That's a GDB bug. GDB shouldn't have given the prompt so soon. I think it did because
the "No such process" error escapes out.
prev parent reply other threads:[~2021-04-13 17:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-18 11:44 Tom de Vries
2021-04-13 13:33 ` Luis Machado
2021-04-13 14:45 ` Pedro Alves
2021-04-13 15:51 ` Luis Machado
2021-04-13 17:50 ` Pedro Alves [this message]
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=5faa429c-6d19-cb46-73c8-69ed2c016f69@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@linaro.org \
--cc=tdevries@suse.de \
/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).