[Libguestfs] [PATCH libnbd] tests: Use libc_malloc_debug.so.0 instead of MALLOC_CHECK_ for glibc 2.34

Richard W.M. Jones rjones at redhat.com
Wed Aug 25 20:27:17 UTC 2021

On Wed, Aug 25, 2021 at 01:26:08PM -0500, Eric Blake wrote:
> On Tue, Aug 24, 2021 at 05:13:24PM +0100, Richard W.M. Jones wrote:
> > This is the nbdkit change transplanted to libnbd.  Because there are
> > several subdirectory Makefiles which define the MALLOC_CHECK_
> > environment variables, I turned it into a macro which is placed in the
> > top level subdir-rules.mk.
> Nice refactoring to avoid duplication.
> > 
> > Note this currently breaks valgrinding because of:
> > https://sourceware.org/bugzilla/show_bug.cgi?id=28256
> > and because there's not a good place to unset GLIBC_TUNABLES in libnbd.
> Patch looks good to apply (I almost tackled the same project myself
> before seeing your email).  Could we modify run.in to define _VG to
> start with 'env -u GLIBC_TUNABLES valgrind' on systems where 'env -u'
> is supported? (Sadly, POSIX doesn't require 'env -u')

I actually thought of another way to fix this but forgot to send a
follow-up email:

diff --git a/valgrind/glibc.suppressions b/valgrind/glibc.suppressions
index a03332d9..d0f8ac52 100644
--- a/valgrind/glibc.suppressions
+++ b/valgrind/glibc.suppressions
@@ -57,3 +57,14 @@
+# Conditional jump or move depends on uninitialised value(s) in
+# __GI___tunables_init
+# https://sourceware.org/bugzilla/show_bug.cgi?id=28256
+# Bug present in glibc 2.34 and fixed in 2.35.
+  glibc_6
+  Memcheck:Cond
+  fun:parse_tunables
+  fun:__GI___tunables_init

This obviously only suppresses the error rather than fixing it but I
tested it and it allows make check-valgrind to pass partially.

There is actually a further error revealed by valgrinding (but
disguised by the above problem) which I'm looking into.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch

More information about the Libguestfs mailing list