appliance: Enhance --enable-valgrind-daemon with a suppressions file.

This lets us suppress errors in system libraries.
This commit is contained in:
Richard W.M. Jones
2012-03-14 16:13:40 +00:00
parent 5da61d3052
commit 302309921a
3 changed files with 26 additions and 3 deletions

View File

@@ -64,12 +64,13 @@ stamp-supermin: make.sh packagelist excludelist
./make.sh
touch $@
supermin.d/daemon.img: ../daemon/guestfsd
supermin.d/daemon.img: ../daemon/guestfsd guestfsd.suppressions
mkdir -p supermin.d
rm -f $@ $@-t
rm -rf tmp
mkdir -p tmp$(DAEMON_SUPERMIN_DIR)
mkdir -p tmp$(DAEMON_SUPERMIN_DIR) tmp/etc
ln ../daemon/guestfsd tmp$(DAEMON_SUPERMIN_DIR)/guestfsd
ln guestfsd.suppressions tmp/etc/guestfsd.suppressions
( cd tmp && find | cpio --quiet -o -H newc ) > $@-t
rm -rf tmp
mv $@-t $@

View File

@@ -0,0 +1,19 @@
# This file is only used when libguestfs is configured with
#
# ./configure --enable-valgrind-daemon
#
# (only used for development, and only used in the regular supermin
# appliance, not libguestfs live).
#
# If there are any valgrind errors in the base libraries such as
# glibc, then we can suppress them here, so we only see errors in
# libguestfs daemon code.
# libdl
{
libdl_index_cond
Memcheck:Cond
fun:index
fun:expand_dynamic_string_token
fun:_dl_map_object
}

View File

@@ -116,8 +116,11 @@ if ! grep -sq guestfs_rescue=1 /proc/cmdline; then
# Run the daemon under valgrind if ./configure --enable-valgrind-daemon
vg_channel=/dev/virtio-ports/org.libguestfs.valgrind
if [ -w $vg_channel ]; then
if [ -r /etc/guestfsd.suppressions ]; then
suppressions="--suppressions=/etc/guestfsd.suppressions"
fi
exec 3>$vg_channel
vg="valgrind --leak-check=full --log-fd=3 --error-exitcode=119 --max-stackframe=8388608 --child-silent-after-fork=yes"
vg="valgrind --leak-check=full --log-fd=3 --error-exitcode=119 --max-stackframe=8388608 --child-silent-after-fork=yes $suppressions"
echo "enabling valgrind: $vg"
fi