summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/pr10854.exp
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-10-27 13:52:34 -0700
committerJosh Stone <jistone@redhat.com>2009-10-27 13:52:34 -0700
commitd117a23e6883640be751523274811d9d5e9dcc11 (patch)
tree8c497957adb940d28ffa3cb7709d87414453b424 /testsuite/systemtap.base/pr10854.exp
parenta1995fef7f86ee6d1c3860cfb7e2652d986e4aa9 (diff)
downloadsystemtap-steved-d117a23e6883640be751523274811d9d5e9dcc11.tar.gz
systemtap-steved-d117a23e6883640be751523274811d9d5e9dcc11.tar.xz
systemtap-steved-d117a23e6883640be751523274811d9d5e9dcc11.zip
PR10854 cont'd: Add a testcase for the reproducer
Diffstat (limited to 'testsuite/systemtap.base/pr10854.exp')
-rw-r--r--testsuite/systemtap.base/pr10854.exp31
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/pr10854.exp b/testsuite/systemtap.base/pr10854.exp
new file mode 100644
index 00000000..11d2221e
--- /dev/null
+++ b/testsuite/systemtap.base/pr10854.exp
@@ -0,0 +1,31 @@
+# This test is to make sure that we've resolved PR10854's race between probe
+# initialization and shutdown. Here we load a module and then kill the stapio
+# process as soon as we can to try to make the init and shutdown overlap.
+
+set test "pr10854"
+
+# precompile the script module
+set compile { exec stap $srcdir/$subdir/$test.stp sys_read *@fs/*.c -p4 }
+if { [catch { set module [eval $compile] } msg ] } {
+ fail "compiling $test.stp: $msg"
+ untested "$test runloop"
+ continue
+} else {
+ pass "compiling $test.stp"
+}
+
+if {![installtest_p]} {
+ untested "$test runloop"
+ continue
+}
+
+# run & kill the module 10 times
+# (this was usually enough to trigger the fault)
+for {set i 0} {$i < 10} {incr i} {
+ spawn staprun $module -o /dev/null
+ while { [catch { exec pkill stapio -P [pid] } msg ] } { }
+ wait
+}
+
+# if we're still alive, we pass :)
+pass "$test runloop"