public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCHv2 1/2] gdb: fix failures in gdb.mi/mi-exec-run.exp with native-extended-gdbserver
Date: Fri, 29 Apr 2022 14:52:56 +0100	[thread overview]
Message-ID: <3a53d99e-7404-7ba4-eb3b-e66af0dc5bf8@palves.net> (raw)
In-Reply-To: <6f0c6ff4f300d81bd063675913bd973cea652afd.1651145162.git.aburgess@redhat.com>

On 2022-04-28 12:27, Andrew Burgess via Gdb-patches wrote:
> When running the gdb.mi/mi-exec-run.exp test using the
> native-extended-gdbserver I see failures like this:
> 
>   FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected
>   FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=separate: force-fail=1: run failure detected
>   FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=separate: force-fail=1: run failure detected
> 
> There's a race condition here, so you might see a slightly different
> set of failures, but I always see some from the 'run failure detected'
> test.
> 
> NOTE: I also see an additional test failure:
> 
>  FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=separate: force-fail=0: breakpoint hit reported on console (timeout)
> 
> but that is a completely different issue, and is not being addressed
> in this commit.
> 
> The problem for the 'run failure detected' test is that we end up
> in gdb_expect looking for output from two spawn-ids, one from
> gdbserver, and one from gdb.  We're looking for one output pattern
> from each spawn-id, and for the test to pass we need to see both
> patterns.
> 
> Now, if gdb exits then this is a test failure (this would indicate gdb
> crashing, which is bad), so we have an eof pattern associated with
> the gdb spawn-id.
> 
> However, in this particular test we expect gdbserver to fail to
> execute the binary (the test binary is set non-executable), and so we
> get an error message from gdbserver (which matches the pattern), and
> then gdbserver exits, this is expected.
> 
> The problem is that after spotting the pattern from gdbserver, we
> often see the eof from gdbserver before we see the pattern from gdb.
> If this happens then we drop out of the gdb_expect without ever seeing
> the pattern from gdb, and fail the test.
> 
> In this commit, I place the spawn-id of gdbserver into a global
> variable, and then use this global variable as the -i option within
> the gdb_expect.
> 
> Now, once we have seen the expected pattern on the gdbserver spawn-id,
> the global variable is cleared.  After this the gdb_expect no longer
> checks the gdbserver spawn-id for additional output, and so never sees
> the eof event.  This leaves the gdb_expect running, which allows the
> pattern from gdb to be seen, and for the test to pass.
> 
> I now see no failures relating to 'run failure detected'.
> ---
>  gdb/testsuite/gdb.mi/mi-exec-run.exp | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)

OK.

  reply	other threads:[~2022-04-29 13:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 18:17 [PATCH 0/2] Fix mi-exec-run.exp " Andrew Burgess
2022-04-27 18:17 ` [PATCH 1/2] gdb: fix failures in gdb.mi/mi-exec-run.exp " Andrew Burgess
2022-04-27 18:42   ` Pedro Alves
2022-04-27 18:17 ` [PATCH 2/2] gdb/testsuite: fix native-extended-gdbserver failure in mi-exec-run.exp Andrew Burgess
2022-04-28 11:27 ` [PATCHv2 0/2] Fix mi-exec-run.exp with native-extended-gdbserver Andrew Burgess
2022-04-28 11:27   ` [PATCHv2 1/2] gdb: fix failures in gdb.mi/mi-exec-run.exp " Andrew Burgess
2022-04-29 13:52     ` Pedro Alves [this message]
2022-04-28 11:27   ` [PATCHv2 2/2] gdb/testsuite: fix native-extended-gdbserver failure in mi-exec-run.exp Andrew Burgess
2022-04-29 14:13     ` Pedro Alves
2022-04-29 18:15       ` [PATCHv3 0/3] gdb/testsuite: fix mi-exec-run.exp Andrew Burgess
2022-04-29 18:15         ` [PATCHv3 1/3] gdb/testsuite: fix mi-exec-run.exp with native-extended-gdbserver board Andrew Burgess
2022-04-29 18:15         ` [PATCHv3 2/3] gdb/testsuite: change mi_gdb_start to take a list of flags Andrew Burgess
2022-04-29 18:15         ` [PATCHv3 3/3] gdb/testsuite: small cleanup in mi-break-qualified.exp Andrew Burgess
2022-05-02 16:37         ` [PATCHv3 0/3] gdb/testsuite: fix mi-exec-run.exp Pedro Alves
2022-05-03  9:49           ` Andrew Burgess

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=3a53d99e-7404-7ba4-eb3b-e66af0dc5bf8@palves.net \
    --to=pedro@palves.net \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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).