From: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
To: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: GDB 8.2.90 available for testing
Date: Thu, 07 Mar 2019 17:42:00 -0000 [thread overview]
Message-ID: <8736ny7f8u.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <20190227055112.4A5E782D7B@joel.gnat.com>
Joel Brobecker <brobecker@adacore.com> writes:
Hello,
There is a regression in the testsuite itself, triggered by errors being
raised from within gdb_test_multiple. This looks like a dejagnu issue,
but it started happening due to a commit that was introduced for this
version, and it can cause the testsuite to hang.
The commit that triggers this is:
fe1a5cad302b5535030cdf62895e79512713d738
[gdb/testsuite] Log wait status on process no longer exists error
The issue is that this commit introduces a new "eof" block in
gdb_test_multiple. It doesn't look incorrect to me, but dejagnu uses
this block as a "default" action when an error is raised from within the
commands inside a call to gdb_test_multiple, which means that it can be
executed even when there was no actual eof and the GDB process is still
running, so the wait introduced in the commit that tries to get the exit
status of GDB hangs forever, while GDB itself waits for input.
This only happens when there are internal testsuite errors (not testcase
failures). I had noticed it before but the issue that caused the error
and triggered this problem was resolved. I saw it again now when I ran
the testsuite on a system that restricts ptrace attach operations, which
causes an error in "gdb.multi/multi-term-settings.exp", which then hangs
the testsuite.
This can be reproduced more easily with a testcase such as:
gdb_start
gdb_test_multiple "show version" "show version" {
-re ".*" {
error "forced error"
}
}
I'm not sure if there is a proper way to work around this in GDB, but it
would be useful so that the testsuite doesn't hang in these cases.
Adding an empty "default" block at the end of the expect body in
gdb_test_multiple doesn't work, because the dejagnu routine that parses
this body and selects the default block to execute after an error is
affected by the comments in the body (since they are also parsed). This
is proc remote_expect (in dejagnu/lib/remote.exp). In fact, there is
already a second eof block that isn't used due to this issue.
If this comment in gdb_test_multiple
# patterns below apply to any spawn id specified.
Is changed to
# The patterns below apply to any spawn id specified.
Then the second eof block is selected and there is no hang-up.
Any comment at that same place with an even-numbered of tokens also
works. Of course, this is an ugly solution, and there could be other
weird side-effects.
Alternatively, the GDB commit that introduced this new eof block could
be reverted. This would be unfortunate since it seems useful, but the
comment for proc remote_expect does specify that the eof/default/timeout
block is used as an error handler, just not which one.
Thanks!
--
Pedro Franco de Carvalho
next prev parent reply other threads:[~2019-03-07 17:42 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 5:51 Joel Brobecker
2019-02-27 22:05 ` Jim Wilson
2019-03-04 11:15 ` Andrew Burgess
2019-03-04 13:57 ` Alan Hayward
2019-03-04 20:00 ` Jim Wilson
2019-02-28 18:31 ` MinGW build of GDB 8.2.90 (was: GDB 8.2.90 available for testing) Eli Zaretskii
2019-02-28 18:55 ` MinGW build of GDB 8.2.90 Sergio Durigan Junior
2019-02-28 19:06 ` LRN
2019-02-28 19:45 ` Eli Zaretskii
2019-02-28 20:17 ` Sergio Durigan Junior
2019-02-28 20:29 ` Eli Zaretskii
2019-02-28 20:37 ` Sergio Durigan Junior
2019-02-28 18:34 ` GDB 8.2.90 available for testing Eli Zaretskii
2019-03-01 16:35 ` Pedro Alves
2019-03-01 18:50 ` Tom Tromey
2019-03-07 22:44 ` Tom Tromey
2019-03-08 7:46 ` Eli Zaretskii
2019-03-08 20:57 ` Tom Tromey
2019-03-09 6:13 ` Eli Zaretskii
2019-03-14 17:32 ` Tom Tromey
2019-03-14 19:49 ` Eli Zaretskii
2019-03-15 12:55 ` Tom Tromey
2019-03-17 15:56 ` Eli Zaretskii
2019-03-17 17:31 ` Tom Tromey
2019-03-17 18:36 ` Eli Zaretskii
2019-03-18 14:13 ` Tom Tromey
2019-03-18 18:08 ` Eli Zaretskii
2019-03-07 17:42 ` Pedro Franco de Carvalho [this message]
[not found] ` <4d855905-32ce-ba4b-72f5-037f1796b37e@redhat.com>
2019-03-22 14:42 ` [PATCH] Fix testsuite hangs when gdb_test_multiple body errors out (Re: GDB 8.2.90 available for testing) Simon Marchi
2019-03-25 13:23 ` Pedro Alves
2019-03-22 20:44 ` Pedro Franco de Carvalho
2019-03-25 13:21 ` Pedro Alves
2019-03-25 19:43 ` Pedro Franco de Carvalho
2019-03-26 18:58 ` Pedro Alves
2019-03-26 21:01 ` Pedro Franco de Carvalho
2019-03-28 17:36 ` Joel Brobecker
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=8736ny7f8u.fsf@linux.vnet.ibm.com \
--to=pedromfc@linux.ibm.com \
--cc=brobecker@adacore.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