This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] testsuite: valgrind-infcall.exp: explicit kill
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 18 Feb 2013 16:45:52 +0100
- Subject: [patch] testsuite: valgrind-infcall.exp: explicit kill
Hi,
occasionally one may get a hanging "valgrind-infcall" process such as:
25196 ? SNs 0:00 valgrind --vgdb-error=0 /unsafe/home/jkratoch/hammock/20130215rel7-rawhide/fedora-rawhide-i386/build/gdb-7.5.50.20130215/build-i686-redhat-linux-gnu/gdb/testsuite.unix.-m32/gdb.base/valgrind-infcall
Normal processing is:
(gdb) target remote | /usr/lib/valgrind/../../bin/vgdb --pid=31017^M
Remote debugging using | /usr/lib/valgrind/../../bin/vgdb --pid=31017^M
relaying data between gdb and process 31017^M
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.^M
Loaded symbols for /lib/ld-linux.so.2^M
0x04001150 in _start () from /lib/ld-linux.so.2^M
(gdb) PASS: gdb.base/valgrind-infcall.exp: target remote for vgdb
monitor v.set gdb_output^M
valgrind output will go to gdb^M
==31017== ^M
(gdb) PASS: gdb.base/valgrind-infcall.exp: monitor v.set gdb_output
It happened once due to this; I do not know how to reproduce it:
(gdb) target remote | /usr/lib/valgrind/../../bin/vgdb --pid=9899^M
Remote debugging using | /usr/lib/valgrind/../../bin/vgdb --pid=9899^M
relaying data between gdb and process 9899^M
Malformed response to offset query, 1^M
(gdb) FAIL: gdb.base/valgrind-infcall.exp: target remote for vgdb
monitor v.set gdb_output^M
"monitor" command not supported by this target.^M
(gdb) FAIL: gdb.base/valgrind-infcall.exp: monitor v.set gdb_output
Another time it happened due to this; I do not know how to reproduce it
(although that happens sometimes more commonly than the one above):
(gdb) target remote | /usr/lib/valgrind/../../bin/vgdb --pid=25196^M
Remote debugging using | /usr/lib/valgrind/../../bin/vgdb --pid=25196^M
vgdb error: no FIFO found matching pid 25196^M
Remote communication error. Target disconnected.: Connection reset by peer.^M
(gdb) FAIL: gdb.base/valgrind-infcall.exp: target remote for vgdb
monitor v.set gdb_output^M
"monitor" command not supported by this target.^M
(gdb) FAIL: gdb.base/valgrind-infcall.exp: monitor v.set gdb_output
I will check it in.
Thanks,
Jan
gdb/testsuite/
2013-02-18 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/valgrind-infcall.exp (valgrind_pid): New variable.
Add final kill of ${valgrind_pid}.
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall.exp b/gdb/testsuite/gdb.base/valgrind-infcall.exp
index 50a273f..5ca83d4 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall.exp
@@ -79,6 +79,7 @@ gdb_test_multiple "" $test {
}
# Do not kill valgrind.
+set valgrind_pid [exp_pid -i [board_info host fileid]]
unset gdb_spawn_id
set board [host_info name]
unset_board_info fileid
@@ -122,3 +123,6 @@ gdb_test_multiple $test $test {
pass $test
}
}
+
+# Only if valgrind got stuck.
+remote_exec host "kill -9 ${valgrind_pid}"