Discussion:
[libvirt] commandtest fails when executed with preloaded libraries
Diego Elio Pettenò
2011-01-06 13:56:21 UTC
Permalink
In Gentoo we sandbox software installation with a software called
sandbox, which basically is a preloaded library that wraps around a
number of file access functions.

This method seems to break commandtest because the environment now has a
LD_PRELOAD variable in it, which is not accounted for in the
pre-generated log files.

Any idea how I should go about to solve this beside adding LD_PRELOAD to
the log files themselves for Gentoo?
--
Diego Elio Pettenò — Flameeyes
http://blog.flameeyes.eu/
Daniel P. Berrange
2011-01-06 14:11:39 UTC
Permalink
Post by Diego Elio Pettenò
In Gentoo we sandbox software installation with a software called
sandbox, which basically is a preloaded library that wraps around a
number of file access functions.
This method seems to break commandtest because the environment now has a
LD_PRELOAD variable in it, which is not accounted for in the
pre-generated log files.
Any idea how I should go about to solve this beside adding LD_PRELOAD to
the log files themselves for Gentoo?
We should add

unsetenv(LD_PRELOAD)
unsetenv(LD_LIBRARY_PATH)

to commandtest.c, because although we want these env variables
in normal usage of the virCommandPtr APIs, they're not desirable
in this test case. Since commandtesthelper doesn't do anything
to the system beyond creating a logfile, I imagine it'd work
fine without gentoo's LD_PRELOAD

Daniel
Eric Blake
2011-01-06 15:31:29 UTC
Permalink
Post by Daniel P. Berrange
Post by Diego Elio Pettenò
In Gentoo we sandbox software installation with a software called
sandbox, which basically is a preloaded library that wraps around a
number of file access functions.
This method seems to break commandtest because the environment now has a
LD_PRELOAD variable in it, which is not accounted for in the
pre-generated log files.
Any idea how I should go about to solve this beside adding LD_PRELOAD to
the log files themselves for Gentoo?
We should add
unsetenv(LD_PRELOAD)
unsetenv(LD_LIBRARY_PATH)
to commandtest.c, because although we want these env variables
in normal usage of the virCommandPtr APIs, they're not desirable
in this test case. Since commandtesthelper doesn't do anything
to the system beyond creating a logfile, I imagine it'd work
fine without gentoo's LD_PRELOAD
Another alternative might be to keep LD_PRELOAD and LD_LIBRARY_PATH
untouched (in case they do prove to be important for figuring out how to
run the child process), but patch commandhelper.c to omit outputting
those two environment variables (they are too unpredictable, and enough
other envvars are tested to make us feel confident that virCommand is
doing the right thing).
--
Eric Blake ***@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
Loading...