This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb.threads/step-after-sr-lock.exp behaving very badly


Hi Pedro,

For some reason the test ends up doing "kill -SIGUSR1 -1".  Which
makes me rather unhappy as it kills all my processes on the machine...

The test hangs early on on OpenBSD (probably because the test program
blocks all signals).  So get_value times out and returns -1.  Since
the effect is fairly disastrous, I went ahead and patched it up with
the diff below.

Cheers,

Mark


>From 1dfdac3275133d51186c6b2c3910bf7043157f1b Mon Sep 17 00:00:00 2001
From: Mark Kettenis <kettenis@gnu.org>
Date: Mon, 10 Feb 2014 17:58:03 +0100
Subject: [PATCH] Avoid killing all processes.

gdb/ChangeLog:

        * gdb.threads/step-after-sr-lock.exp: Avoid executing
        "kill -SIGUSR1 -1".
---
 gdb/testsuite/ChangeLog                          | 5 +++++
 gdb/testsuite/gdb.threads/step-after-sr-lock.exp | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a9021cb..6216b25 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-10  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdb.threads/step-after-sr-lock.exp: Avoid executing
+	"kill -SIGUSR1 -1".
+
 2014-02-10  Joel Brobecker  <brobecker@adacore.com>
 
 	* gdb.ada/tick_length_array_enum_idx: New testcase.
diff --git a/gdb/testsuite/gdb.threads/step-after-sr-lock.exp b/gdb/testsuite/gdb.threads/step-after-sr-lock.exp
index 6b93d9c..bf5ea60 100644
--- a/gdb/testsuite/gdb.threads/step-after-sr-lock.exp
+++ b/gdb/testsuite/gdb.threads/step-after-sr-lock.exp
@@ -68,6 +68,9 @@ gdb_continue_to_breakpoint "run to breakpoint"
 gdb_test "info threads" "" "info threads with thread 3"
 
 set testpid [get_value "pid" "get pid of inferior"]
+if { $testpid == -1 } {
+    return -1
+}
 
 gdb_test "set scheduler-locking on"
 
-- 
1.8.4



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]