This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap 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]

Re: Systemtap do_filp_open failure on a few linux packages


On 06/15/2013 04:52 PM, Henrik /KaarPoSoft wrote:
> Dear all,
> 
> I have experienced a very strange issue related to systemtap.
> Any insights or help you might be able to provide to help me debug this
> further would be most appreciated.
> 
> I am developing a linux distribution called KaarPux:
> http://kaarpux.kaarposoft.dk/
> 
> Using a few scripts, some 600+ linux packages are build and installed.
> Generally, this works like a charm.
> 
> In order to automatically collect package dependencies, I have created
> a small systemtap script to show files opened for reading:
> http://sourceforge.net/p/kaarpux/code/ci/be342bf5667253421f562b7bc29bab8e0a2560aa/tree/master/chroot_scripts/kx_open.stp

The script looks reasonable. One small note, you shouldn't need the
'@defined($return)' check since $return should always be defined in
'kernel.function("do_filp_open").return'.

...

> For most of the 600+ packages, building is successfull, and the probe
> returns what seems to be reasonable results.
> 
> However, for a few packages, building fails:
> - firefox
> - thunderbird
> - libreoffice
> - ghc-binary
> - ghc

Here's my thought. I don't think it is the probe itself that is causing
the problem, my guess would be that it is our staprun loader (a setuid
executable). When the module gets loaded, we unset several environment
variables, like 'IFS', 'CDPATH', 'ENV', 'BASH_ENV' for security reasons.

I'd guess those failing packages depend on something set in the environment.

If this is the case, to work around this problem you might be able to
modify the script you use to run staprun (linux_functions.shinc) to add
the environment variable back in. Here's that line from
linux_functions.shinc (split up a bit):

====
 staprun /lib/modules/$(uname -r)/systemtap/kx_open.ko \
  -c "./scripts/${PASS}/${PKG}_${STEP}.sh" \
  -o "${PIPE}" > ./log/${PASS}/${PKG}_${STEP}.log 2>&1
====

You could change that to

====
  staprun /lib/modules/$(uname -r)/systemtap/kx_open.ko \
   -c "env 'FOO=BAR' ./scripts/${PASS}/${PKG}_${STEP}.sh" \
   -o "${PIPE}" > ./log/${PASS}/${PKG}_${STEP}.log 2>&1
====

Your other option would be to put the missing environment variable in
scripts/${PASS}/${PKG}_${STEP}.sh.

This might not be the problem, but it is certainly worth investigating.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)


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