public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Handle SIGSEGV in gdb selftests
@ 2022-12-27 17:22 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-12-27 17:22 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=59132fd9777442eea8c05c6b4b96cee03c6273b3

commit 59132fd9777442eea8c05c6b4b96cee03c6273b3
Author: Tom Tromey <tromey@adacore.com>
Date:   Thu Dec 15 14:12:05 2022 -0700

    Handle SIGSEGV in gdb selftests
    
    The gdb.gdb self-tests were timing out for me, which turned out to be
    PR testsuite/29325.  Looking into it, the problem is that the version
    of the Boehm GC that is used by Guile on my machine causes a SEGV
    during stack probing.  This unexpected stop confuses the tests and
    causes repeated timeouts.
    
    This patch adapts the two failing tests.  This makes them work for me,
    and reduces the running time of gdb.gdb from 20 minutes to about 11
    seconds.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29325

Diff:
---
 gdb/testsuite/gdb.gdb/python-helper.exp | 6 ++++++
 gdb/testsuite/gdb.gdb/selftest.exp      | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp
index 3585ac9f0bf..fc52929489e 100644
--- a/gdb/testsuite/gdb.gdb/python-helper.exp
+++ b/gdb/testsuite/gdb.gdb/python-helper.exp
@@ -93,6 +93,12 @@ proc test_python_helper {} {
     # here.
     gdb_test_multiple "continue" "start inner gdb" {
 	-i "$inferior_spawn_id"
+	-re "received signal SIGSEGV.* in GC_.*$outer_prompt_re" {
+	    # Some versions of the GC used by Guile cause a SEGV
+	    # during stack probing.  Ignore this and carry on.
+	    send_gdb "continue\n"
+	    exp_continue
+	}
 	-re "\r\n$gdb_prompt $" {
 	    pass $gdb_test_name
 	}
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index ca1e7cffb4e..e2b9247f65d 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -75,6 +75,12 @@ proc test_with_self { } {
 	set test "xgdb is at prompt"
 	gdb_test_multiple "continue" $test {
 	    -i "$inferior_spawn_id"
+	    -re "received signal SIGSEGV.* in GC_.*$gdb_prompt" {
+		# Some versions of the GC used by Guile cause a SEGV
+		# during stack probing.  Ignore this and carry on.
+		send_gdb "continue\n"
+		exp_continue
+	    }
 	    -re "$banner" {
 		pass $test
 	    }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-27 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 17:22 [binutils-gdb] Handle SIGSEGV in gdb selftests Tom Tromey

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).