From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 579FE3858C27 for ; Sat, 31 Oct 2020 12:50:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 579FE3858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 4765030278CD; Sat, 31 Oct 2020 13:50:06 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id ECE434001999; Sat, 31 Oct 2020 13:50:05 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [COMMITTED] tests: Add dlopen override to dwfl-proc-attach for old glibc/valgrind. Date: Sat, 31 Oct 2020 13:50:04 +0100 Message-Id: <20201031125004.6312-1-mark@klomp.org> X-Mailer: git-send-email 2.18.4 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2020 12:50:08 -0000 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 --- tests/ChangeLog | 4 ++++ tests/dwfl-proc-attach.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/ChangeLog b/tests/ChangeLog index 17c6ba2d..af8ece63 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2020-10-31 Mark Wielaard + + * dwfl-proc-attach.c (dlopen): New external function override. + 2020-10-31 Mark Wielaard * test-wrapper.sh: Use =, not == for string compare. diff --git a/tests/dwfl-proc-attach.c b/tests/dwfl-proc-attach.c index b72cc814..d02e9fc0 100644 --- a/tests/dwfl-proc-attach.c +++ b/tests/dwfl-proc-attach.c @@ -107,4 +107,16 @@ main (int argc __attribute__ ((unused)), 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__ */ -- 2.18.4