Bug 4466 - system_func (0,1,1) fails on ppc64.
Summary: system_func (0,1,1) fails on ppc64.
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: testsuite (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-07 13:50 UTC by Srinivasa DS
Modified: 2007-09-17 17:06 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srinivasa DS 2007-05-07 13:50:06 UTC
My environment is kernel-2.6.21-rc7, systemtap-20070505, elfutils-0.125

Systemtap.samples/system_func.stp probes sys_open and prints "sys_open". But
system_func.stp taking some time to print "sys_open" and  hence system_func.exp
which greps "sys_open" is failing.

==================================================================
Running
/home/systemtap/tmp/stap_testing_200705070516/src/testsuite/systemtap.samples/system_func.e
xp ...
cat: __xyzzy123ABC__: No such file or directory
root

Waititing for processes to exit
DONE
FAIL: system_func (0,1,1)
testcase
/home/systemtap/tmp/stap_testing_200705070516/src/testsuite/systemtap.samples/system_func.
exp completed in 6 seconds
================================================
I have added extra 10 secs timer to wait for "sys_open" message. This fixes the
problem.
=======================================
#! stap

# test the system() function

probe kernel.function("sys_open") {
  # very inefficient. Testing only. DO NOT DO THIS
  msg="echo sys_open"
  system(msg)
}

probe begin {
  # should succeed
  system("whoami")

  # should fail
  system("cat __xyzzy123ABC__")

}

probe timer.ms(10000)
{
exit()
}

probe end {
  # should succeed
  system("echo DONE")
}
============================
Comment 1 Frank Ch. Eigler 2007-05-07 14:46:36 UTC
This is an example of a common race between "begin" and other probes.
Or at least, there used to be a race.  Now, begin probes are strictly
done first, and kprobes etc. are only registered afterward.

What could work here even better is an added timer probe that is bound
to run while the kprobes are active, and thus trigger sys_open soon:

probe timer.ms(500) { system ("cat DOESNOTEXIST") }
Comment 2 Martin Hunt 2007-05-07 18:13:11 UTC
Fixed to generate a call to sys_open() aftern the begin probe is run.
Comment 3 Srinivasa DS 2007-05-29 04:48:32 UTC
Bug is getting reproduced on systemtap-20070526 build.
Comment 4 Martin Hunt 2007-09-17 17:06:20 UTC
Looks like there is still a race. Checked in some additional fixes.