Some combination of old glibc and valgrind create unsuppressable memory
leak warnings when the process is run under valgrind, is multi-threaded
and uses dlopen. libdw will try to dlopen libdebuginfod be default.
So simply override dlopen and always return NULL to make sure
libdebuginfod is never loaded. The dwfl-proc-attach test doesn't rely
on libdebuginfod anyway.
This was seen on the armbian buildbot which uses valgrind 3.14.0 and
glibc 2.28.
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2020-10-31 Mark Wielaard <mark@klomp.org>
+
+ * dwfl-proc-attach.c (dlopen): New external function override.
+
2020-10-31 Mark Wielaard <mark@klomp.org>
* test-wrapper.sh: Use =, not == for string compare.
return (threads == 3) ? 0 : -1;
}
+/* HACK. This is a simple workaround for a combination of old glibc
+ and valgrind. libdw will try to dlopen libdebuginfod this causes
+ some unsuppressable memory leak warnings when the process is
+ multi-threaded under valgrind because of some bad backtraces.
+ So simply override dlopen and always return NULL so libdebuginfod
+ (and libcurl) are never loaded. This test doesn't rely on
+ libdebuginfod anyway. */
+void *dlopen (void)
+{
+ return NULL;
+}
+
#endif /* __linux__ */