PR19874 brown paper bag fix

This commit is contained in:
Frank Ch. Eigler 2016-03-28 09:03:03 -04:00
parent 7a4c555a29
commit 3da32829c7

52
pr19874.patch Normal file
View File

@ -0,0 +1,52 @@
commit 10c48d46fa482b8cc762592aaee6c7cc178356e7 (HEAD -> master, origin/master, origin/HEAD)
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Mon Mar 28 08:54:11 2016 -0400
PR19874: reset 60s alarm for "stap -c CMD"
Brown paper bag bug. Test case included.
diff --git a/staprun/mainloop.c b/staprun/mainloop.c
index 82c0c74fcf0c..874fbd8f8a99 100644
--- a/staprun/mainloop.c
+++ b/staprun/mainloop.c
@@ -281,6 +281,7 @@ void start_cmd(void)
raise (SIGCONT); /* Harmless; just passes control to parent. */
#endif /* !WORKAROUND_BZ467568 */
+ alarm(0); /* clear alarms */
dbug(1, "execing target_cmd %s\n", target_cmd);
/* Note that execvp() is not a direct system call; it does a $PATH
diff --git a/testsuite/systemtap.base/staprunwait.exp b/testsuite/systemtap.base/staprunwait.exp
new file mode 100644
index 000000000000..fc719730bc4c
--- /dev/null
+++ b/testsuite/systemtap.base/staprunwait.exp
@@ -0,0 +1,17 @@
+set test staprunwait
+
+if {! [installtest_p]} { untested $test; return }
+
+foreach runtime [get_runtime_list] {
+ if {$runtime != ""} {
+ set ok [catch {exec stap $srcdir/$subdir/$test.stp --runtime=$runtime -c "sleep 120"} foo]
+ } else {
+ set ok [catch {exec stap $srcdir/$subdir/$test.stp -c "sleep 120"} foo]
+ }
+ verbose -log "$ok $foo"
+ if {$ok != 0} {
+ fail "$test $runtime"
+ } else {
+ pass "$test $runtime"
+ }
+}
diff --git a/testsuite/systemtap.base/staprunwait.stp b/testsuite/systemtap.base/staprunwait.stp
new file mode 100644
index 000000000000..91cbc92446c4
--- /dev/null
+++ b/testsuite/systemtap.base/staprunwait.stp
@@ -0,0 +1,3 @@
+#! /usr/bin/env stap
+
+probe timer.s(10) { println(ctime()) }