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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id AF5B8385801D for ; Fri, 10 Dec 2021 19:15:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF5B8385801D Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-228-8fKqRXePOweIIixAsEEVHA-1; Fri, 10 Dec 2021 14:15:27 -0500 X-MC-Unique: 8fKqRXePOweIIixAsEEVHA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25219835E24; Fri, 10 Dec 2021 19:15:26 +0000 (UTC) Received: from greed.delorie.com (ovpn-112-7.rdu2.redhat.com [10.10.112.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E91B145D7A; Fri, 10 Dec 2021 19:15:22 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.15.2/8.15.2) with ESMTP id 1BAJFLXS4072672; Fri, 10 Dec 2021 14:15:21 -0500 From: DJ Delorie To: Mark Wielaard Cc: alexandra.khirnova@gmail.com, libc-alpha@sourceware.org, ahajkova@redhat.com Subject: Re: [PATCH] Add valgrind smoke test In-Reply-To: Date: Fri, 10 Dec 2021 14:15:21 -0500 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 10 Dec 2021 19:15:32 -0000 Mark Wielaard writes: >> I.e. (in short): >> >> ${...} /bin/sh valgrind foo <- runs /bin/sh with new glibc >> /bin/sh ${...} valgrind foo <- runs valgrind with new glibc >> /bin/sh valgrind ${...} foo <- runs foo with new glibc > > The intent is to test the valgrind available in the test environment > against the just-built glibc (that is both valgrind and the test binary > valgrind-test, which are really the same process) More like a mix: /bin/sh ${...} valgrind ${...} foo The ${...} is all the variables needed to run in the just-built environment, so ${test_wrapper_env} ${run_program_env} $rtld --library-path "$library_path" You need to include all that muck for each binary you want to run in the just-built environment; it's not inherited. Although you likely don't want the test_wrapper_env for the "foo" as it might include a nested ssh, it's complicated and requires a bit of trial and error. You definitely need the rest else the test program will use the target's system libc. >> (in general, testing in a cross-compiled case is an excellent way to >> see >> if you got the rtld stuff in the right place ;-) > > I never did a cross-compiled case. Is there a description of that > process? You can use build-many-glibcs to do a cross build but I don't know if that supports running the testsuite fully. Typically you'd have a remote machine you can ssh to, which nfs mounts your build to the same path, then set a variable to wrap all the tests in a script that ssh's. https://sourceware.org/glibc/wiki/Testing/Testsuite#Testing_with_a_cross-compiler Look at glibc's scripts/cross-test-ssh.sh for instructions > See also my other comment in > https://sourceware.org/pipermail/libc-alpha/2021-December/133714.html > > This tests not just a simple malloc/free pair, but also various > string/path comparisons, dlopen, etc. which in the past have seen > issues with valgrind. Ok.