From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id C79651F4C1 for ; Mon, 28 Nov 2022 13:52:33 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; secure) header.d=web.de header.i=@web.de header.b="ACUI4re/"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231462AbiK1Nvs (ORCPT ); Mon, 28 Nov 2022 08:51:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231651AbiK1Nvq (ORCPT ); Mon, 28 Nov 2022 08:51:46 -0500 Received: from mout.web.de (mout.web.de [212.227.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC8501FA for ; Mon, 28 Nov 2022 05:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1669643489; bh=w3Nn+yD6qR9t/FSVvnGBstyq/o6ueZm3tIWTZjVO9jE=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=ACUI4re/v481U6gJCnIy4IugmtudbQXZuz5mFfG21dMQ7xfrZJlwkiqpZ1IrnfLzh I/GENLFsov8kbOE806nplnUmsweitBAvcfD6a0TXlVQCaJvOlHMnsppF1BqkEZ8/cH nEd9qHN3ho5lZeNT6529TuO6tlSp4Gs2VmNCySRc1DiJjZDufMLZ87IUrFCyQVAuXE U0h2JoFL5F8JLIg/ejoFC2k6t/xDuBbQizySEMsLxz3shpZR0x/CXk+FqnYc4YnpfZ 5Muma8TNfHB7qyWlgVXNsOBKWLV9mpvvtHRo63hgNDYpf5gV6pwUFGArwL24uu1Vnr CxvSaFNyO8wWw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.35] ([91.47.154.159]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MN6Bb-1pGUZY34on-00JCam; Mon, 28 Nov 2022 14:51:29 +0100 Message-ID: <96a2f70d-c338-a992-a3e4-3e6b82b644ca@web.de> Date: Mon, 28 Nov 2022 14:51:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH] t5314: check exit code of "rev-parse" To: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org Cc: Junio C Hamano , Taylor Blau , Jeff King , Christian Couder References: <221128.868rjvmi3l.gmgdl@evledraar.gmail.com> From: =?UTF-8?Q?Ren=c3=a9_Scharfe?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Ly2t/5CgfHz446Rfj34yYLYypG5DDg4AD+GWxvRs9aNMlBXw7A4 qEcaZgBEP8JIa9njsByp8HaFhxfjCjlpnSPPAtDvesCF2JRXyI2LsaG5QHMTs1vE2f1CMdN MSJA6xn/UXHhUqiWYgPJOxSUobk/qmhPNnxryf7MG5cVuveBvorLoqnVmUlbOvqWawCMg6P ly2HNHK68pXHKoSX2LbIA== UI-OutboundReport: notjunk:1;M01:P0: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=B6r=C3=B0 Bjarmason: > Amend the test added in [1] to check the exit code of the "rev-parse" > invocations. An in-flight change[2] introduced a memory leak in these > invocations, which went undetected unless we were running under > "GIT_TEST_SANITIZE_LEAK_LOG=3Dtrue". Checking the return code of rev-parse might be a good idea, but AFAICS none of the patches in the thread around [2] add a leak to it; they are only about pack-objects. So that's not how this patch works. > Note that the in-flight change made 8 test files fail, but as far as I > can tell only this one would have had its exit code hidden unless > under "GIT_TEST_SANITIZE_LEAK_LOG=3Dtrue". The rest would be caught > without it. > > 1. 4cf2143e029 (pack-objects: break delta cycles before delta-search > phase, 2016-08-11) > 2. https://lore.kernel.org/git/221128.868rjvmi3l.gmgdl@evledraar.gmail.c= om/ > 3. faececa53f9 (test-lib: have the "check" mode for SANITIZE=3Dleak > consider leak logs, 2022-07-28) > > Signed-off-by: =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason > --- > > Aside from rs/multi-filter-args, we should be checking the return code > of "git" in these cases. > > t/t5314-pack-cycle-detection.sh | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/t/t5314-pack-cycle-detection.sh b/t/t5314-pack-cycle-detect= ion.sh > index 73a241743aa..169d8198641 100755 > --- a/t/t5314-pack-cycle-detection.sh > +++ b/t/t5314-pack-cycle-detection.sh > @@ -63,13 +63,16 @@ TEST_PASSES_SANITIZE_LEAK=3Dtrue > # Note that the two variants of "file" must be similar enough to convin= ce git > # to create the delta. > make_pack () { > - { > - printf '%s\n' "-$(git rev-parse $2)" > - printf '%s dummy\n' "$(git rev-parse $1:dummy)" > - printf '%s file\n' "$(git rev-parse $1:file)" > - } | > - git pack-objects --stdout | THIS is how it works: pack-objects with the patch in the grandparent of [2] and built with SANITIZE=3Dleak fails here, but the test marches on, ignoring its return value. > - git index-pack --stdin --fix-thin > + grp1=3D$(git rev-parse "$2") && > + grp2=3D$(git rev-parse "$1:dummy") && > + grp3=3D$(git rev-parse "$1:file") && Nit: "grp" expands to "group" in my mind. Here it stands for "git rev-parse", hmm. "commit", "dummy_blob" and "file_blob" might be better names. > + cat >list <<-EOF > + -$grp1 > + $grp2 dummy > + $grp3 file > + EOF > + git pack-objects --stdout pack && Here's the new return code check that makes the test detect the diffopt leak in question. > + git index-pack --stdin --fix-thin } > > test_expect_success 'setup' '