public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* problem with running a direct command
@ 2013-05-14 12:57 corpaul
  2013-05-14 16:52 ` Josh Stone
  0 siblings, 1 reply; 3+ messages in thread
From: corpaul @ 2013-05-14 12:57 UTC (permalink / raw)
  To: systemtap

I'm having the following issue with Systemtap:

When I probe a specific application with the following command:
~/systemtap/stap/bin/stap ~/systemtap/probes/logIOWrites.stp
-DMAXMAPENTRIES=10000 -DSTP_NO_OVERLOAD -DMAXSTRINGLEN=4096
-DTRYLOCKDELAY=300 -DMAXSKIPPED=10000 -DMAXACTION=1000 -c'./tribler.sh'

The application gives me an error:
Traceback (most recent call last):
  File "Tribler/Main/tribler.py", line 28, in <module>
    from Tribler.Core.Libtorrent.LibtorrentMgr import LibtorrentMgr
  File "/home/user/src/tribler/Tribler/Core/Libtorrent/LibtorrentMgr.py",
line 6, in <module>
    import libtorrent as lt
ImportError: libboost_python-py27.so.1.49.0: cannot open shared object file:
No such file or directory

However, when I start the probe without the direct command and start
./tribler.sh in another terminal, the probe and application work fine. Does
Systemtap make a change in the LD_LIBRARY_PATH or something?

--CP



--
View this message in context: http://sourceware-org.1504.n7.nabble.com/problem-with-running-a-direct-command-tp231745.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: problem with running a direct command
  2013-05-14 12:57 problem with running a direct command corpaul
@ 2013-05-14 16:52 ` Josh Stone
  2013-05-15  7:27   ` Cor-paul Bezemer - EWI
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Stone @ 2013-05-14 16:52 UTC (permalink / raw)
  To: corpaul; +Cc: systemtap

On 05/14/2013 05:57 AM, corpaul wrote:
> Does Systemtap make a change in the LD_LIBRARY_PATH or something?

Yes, this is a consequence of going through our staprun loader, which is
a setuid executable.  LD_LIBRARY_PATH, LD_PRELOAD, and several others
are removed and ignored from all setuid/setgid executables for security
reasons.

We could possibly backup these variables somehow, and restore them after
we've dropped privileges, but I'm always hesitant to mess with
security-sensitive code.

Since you're already using a script, tribler.sh, can you set the
relevant environment in there?  Or another option is to set this in the
command invocation, like:

  stap .... -c "env 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH' ./tribler.sh"

Note the double-quotes to let it expand early, and single-quotes to
preserve any spacing when it runs.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: problem with running a direct command
  2013-05-14 16:52 ` Josh Stone
@ 2013-05-15  7:27   ` Cor-paul Bezemer - EWI
  0 siblings, 0 replies; 3+ messages in thread
From: Cor-paul Bezemer - EWI @ 2013-05-15  7:27 UTC (permalink / raw)
  To: Josh Stone; +Cc: systemtap

Works excellent, thanks!

--CP
________________________________________
From: Josh Stone [jistone@redhat.com]
Sent: Tuesday, May 14, 2013 6:52 PM
To: Cor-paul Bezemer - EWI
Cc: systemtap@sourceware.org
Subject: Re: problem with running a direct command

On 05/14/2013 05:57 AM, corpaul wrote:
> Does Systemtap make a change in the LD_LIBRARY_PATH or something?

Yes, this is a consequence of going through our staprun loader, which is
a setuid executable.  LD_LIBRARY_PATH, LD_PRELOAD, and several others
are removed and ignored from all setuid/setgid executables for security
reasons.

We could possibly backup these variables somehow, and restore them after
we've dropped privileges, but I'm always hesitant to mess with
security-sensitive code.

Since you're already using a script, tribler.sh, can you set the
relevant environment in there?  Or another option is to set this in the
command invocation, like:

  stap .... -c "env 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH' ./tribler.sh"

Note the double-quotes to let it expand early, and single-quotes to
preserve any spacing when it runs.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-15  7:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-14 12:57 problem with running a direct command corpaul
2013-05-14 16:52 ` Josh Stone
2013-05-15  7:27   ` Cor-paul Bezemer - EWI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).