[Libguestfs] [PATCH nbdkit v2 2/2] wrapper: Remove GLIBC_TUNABLES when running under valgrind

Richard W.M. Jones rjones at redhat.com
Tue Aug 24 09:22:41 UTC 2021

There's a problem here ...

For background see:
(You have to click the "..." in that email)

If libc_malloc_debug.so.0 isn't installed then LD_PRELOAD generates
lots of warning messages and this actually breaks some tests.

If ./configure is used without --libdir then we try to set
LD_PRELOAD=/usr/local/lib/libc_malloc_debug.so.0 which causes the

My first idea was to test in ./configure if $libdir/libc_malloc_debug.so.0
exists and only set LD_PRELOAD if so.  However that doesn't work
because of $!"£% exec_prefix (a.k.a. the most useless GNU feature that
no one uses but causes all the trouble).

Also if you have glibc.i686 and glibc.x86_64 installed then both
/lib64/libc_malloc_debug.so.0 and /lib/libc_malloc_debug.so.0 exist
and you must choose the correct one.  On other distros the path will
be different, eg. the 64 bit one in /lib/libc_malloc_debug.so.0 or
/lib/x86_64-linux-gnu/... etc.

So I don't know how to solve any of this.  It would be nicer if glibc
handled the details and automatically loaded the right library if


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.

More information about the Libguestfs mailing list