From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 2D13E3857C7F for ; Mon, 24 May 2021 14:28:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2D13E3857C7F Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-439-LjUpTQU1MjOEtQYQoicxTQ-1; Mon, 24 May 2021 10:28:14 -0400 X-MC-Unique: LjUpTQU1MjOEtQYQoicxTQ-1 Received: by mail-qk1-f199.google.com with SMTP id i141-20020a379f930000b02902e94f6d938dso26982561qke.5 for ; Mon, 24 May 2021 07:28:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=QKPToaUE1/7WcSYK3ROVSTt2HHj9wGF/h2g1cG/hKHI=; b=U2oOaRZNplODubmhJiyYTPih0hAkpLNLRiyO1hnEieEyRKIhMN9o2coIhPL3Jm87LZ j6riPk5FrjOL1L8Y60ytJ6PTDRrqUvWBygER3KM5YG3rycYN46i37SCPMdMPA1gzsi1t KVDvpS6kdcyNb9iTBw4Zd97utuzAU1On+3I8dsE8MJ05yYa1GeX1i2kbA21TJg05fQ0O WPViU1ANgi991yJrzWtEcLoEhiBq28UM9GU9ikZfoiZrbo07W59Yn7qC4d9EAEKzFc8M nKzp6+3lAiv0X+9YSiKlCtjfInY5yo78rxu/oXn1sz3MQ4Io0/tfxJBvvSbndxHr4Mj+ ViKg== X-Gm-Message-State: AOAM531SwntVQCQiysjtNT5Nz3OZTIBY8/KEWijL8aRbDuQP0lPyETGC C8K680XH1L/4W/QZFbkaJMqyw/atLDqWKv0HxpaC8ApIAmg8P7GP8clXmwQDnGREw7NeRKjDpuN TPiKZx8HdbEQvL85SL0Vn X-Received: by 2002:a05:620a:146d:: with SMTP id j13mr28609320qkl.493.1621866493496; Mon, 24 May 2021 07:28:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzza65WmIzn9WJ1nQdnyPUEHvjKZwSmKj7uUL0LakkAiBNFm5w3qV4T8xj1+Osk6IGcrSjJZA== X-Received: by 2002:a05:620a:146d:: with SMTP id j13mr28609303qkl.493.1621866493284; Mon, 24 May 2021 07:28:13 -0700 (PDT) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id u26sm10399866qtf.24.2021.05.24.07.28.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 07:28:12 -0700 (PDT) Subject: Re: [PATCH] Add valgrind smoke test To: =?UTF-8?Q?Alexandra_H=c3=a1jkov=c3=a1?= , libc-alpha@sourceware.org Cc: =?UTF-8?Q?Alexandra_H=c3=a1jkov=c3=a1?= References: <20210524121532.1374966-1-ahajkova@redhat.com> From: Carlos O'Donell Organization: Red Hat Message-ID: Date: Mon, 24 May 2021 10:28:11 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210524121532.1374966-1-ahajkova@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2021 14:28:26 -0000 On 5/24/21 8:15 AM, Alexandra Hájková via Libc-alpha wrote: > From: Alexandra Hájková > > Check if valgrind is present during the configure time and > run smoke tests with valgrind to verify dynamic loader. Thanks for proposing this. We have been running similar valgrind smoke tests in Fedora Rawhide and it is very beneficial. > --- > Makefile | 4 +++ > configure | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > configure.ac | 1 + > elf/Makefile | 8 +++++ > 4 files changed, 106 insertions(+) > > diff --git a/Makefile b/Makefile > index 50f99ca611..a9ae15d65e 100644 > --- a/Makefile > +++ b/Makefile > @@ -146,6 +146,7 @@ GCONV_PATH="$${builddir}/iconvdata" > usage () { > echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1 > echo " $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1 > + echo " $$0 --tool=valgrind-test PROGRAM [ARGUMENTS...]" 2>&1 OK. Add valgrind-test to testrun.sh. > exit 1 > } > > @@ -181,6 +182,9 @@ case "$$toolname" in > valgrind) > exec env $(run-program-env) valgrind $(test-via-rtld-prefix) $${1+"$$@"} > ;; > + valgrind-test) > + exec env $(run-program-env) valgrind -q --error-exitcode=1 $(test-via-rtld-prefix) $${1+"$$@"} > + ;; OK. > container) > exec env $(run-program-env) $(test-via-rtld-prefix) \ > $(common-objdir)/support/test-container \ > diff --git a/configure b/configure > index 5dde2ba355..769341ef05 100755 > --- a/configure > +++ b/configure OK. > --- a/configure.ac > +++ b/configure.ac > @@ -52,6 +52,7 @@ fi > AC_SUBST(cross_compiling) > AC_PROG_CPP > AC_CHECK_TOOL(READELF, readelf, false) > +AC_CHECK_TOOL([VALGRIND], [valgrind], [false]) OK. > > # We need the C++ compiler only for testing. > AC_PROG_CXX > diff --git a/elf/Makefile b/elf/Makefile > index 834ec858a8..5b72cc76f9 100644 > --- a/elf/Makefile > +++ b/elf/Makefile > @@ -49,6 +49,14 @@ ifeq (yesyes,$(build-shared)$(run-built-tests)) > tests-special += $(objpfx)list-tunables.out > endif > > +# Run smoke tests with valgrind to verify dynamic loader > +ifneq ($(VALGRIND),false) > +tests-special += $(objpfx)valgrind-smoke-test.out > +$(objpfx)valgrind-smoke-test.out: $(objpfx)ld.so > + $(common-objpfx)testrun.sh --tool=valgrind-test /usr/bin/true > $@ > + $(common-objpfx)testrun.sh --tool=valgrind-test /usr/bin/true --help >> $@ > +endif Does this work for cross-compiling? Do you correctly detect the target valgrind and does the test wrapper allow the correct execution of valgrind on the target system? Please see scripts/cross-test-ssh.sh. > + > # Make sure that the compiler does not insert any library calls in tunables > # code paths. > ifeq (yes,$(have-loop-to-function)) > -- Cheers, Carlos.