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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-11.5 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_DKIM_WL shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 4BA511F852 for ; Wed, 12 Jan 2022 11:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352996AbiALL7K (ORCPT ); Wed, 12 Jan 2022 06:59:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240123AbiALL7J (ORCPT ); Wed, 12 Jan 2022 06:59:09 -0500 Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27127C06173F for ; Wed, 12 Jan 2022 03:59:09 -0800 (PST) Received: by mail-ua1-x930.google.com with SMTP id c36so4161181uae.13 for ; Wed, 12 Jan 2022 03:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=RZsp3G3hMwKtST6Od6ZXjAyAM3rtKeua25sWJ9G3x30=; b=mRGdiKlhNIAtBD0MpO1Cib1lPCmWlN0+C4CdtQVSm6bODX10F7YBbs4c1sdZZNqFh/ al8jIZNSJdJEtFDnNWk5RKZ4/Beha1POufiOskZ9s1/ffRQjqZEnwpwK7yjCrT57H48I Ct4hyo2PJiEPwBX7sw4qj1fzbyRWfk5Rvaf4413DaoTscMIrokJmuNwUgjWnnMpOXG9Q GN6X55Aio2FePD9nVxvsPAdjcRHyX3HkrFejEBvaswKAlWuJNGY5ToEeRBwwg9L4413l bzne4ofuVLiEXwn8M2rOf2GpKNQC2pnFjB6owOVBAYba19pW30xvy89lNRJ+UuHaxjb0 qM4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RZsp3G3hMwKtST6Od6ZXjAyAM3rtKeua25sWJ9G3x30=; b=PYubnW9Jvzrh4OIz12rqgrxTxbxTPde8aBIV9kzTx0Y/MuJwSCk6SQrFov5Jd8owgM 3l+ZAA0r/39Nfba0oTBBRl4pbVy4JmKYGmLg6Uz7NSPtrEo2gxfJ849G0G8dmbVRqFge Z6uAiLf7RP/yhlAsOuzypxakPS1yzcaqvLAyaOG0uy/LoAR3GmmVSXlOQCot0B0deDsS TOqJ7p/c+W1C7KThM+aqC5kO7oMFx24+OZxgrBi1/0HBR1BGGbyK3Pes4MzkLSclTv0w x8SY5JXmm5KBlqJwUTKuIlCXwbKzPqlpvGjcKgDWNAQZlBpEDVsuhT0ajiMiOsRZAVoc jcBQ== X-Gm-Message-State: AOAM532jxIuJkl2eD+JSnEuEMYZtarzAjGcPtIqa6ihB76WHX6DWw1cu DJ1gqg88rQpiSKOBpyt+QLmYR683ivQyn1+UKF3BoQ== X-Google-Smtp-Source: ABdhPJxSC18JnDIGSI5dJsNAJzlDuR3JCZeEe/wAG+k9KELpc6NLjRXnRCDfrXttEuuP6R9nMXbLqTIirF1+cSu3++A= X-Received: by 2002:a05:6102:2451:: with SMTP id g17mr3840743vss.8.1641988748166; Wed, 12 Jan 2022 03:59:08 -0800 (PST) MIME-Version: 1.0 References: <9ab631a3b29addaa54415139e7f60a79a19a6edb.1640199396.git.gitgitgadget@gmail.com> In-Reply-To: From: Han-Wen Nienhuys Date: Wed, 12 Jan 2022 12:58:57 +0100 Message-ID: Subject: Re: [PATCH v5 02/16] reftable: fix resource leak in block.c error path To: Junio C Hamano Cc: Han-Wen Nienhuys via GitGitGadget , git@vger.kernel.org, Jeff King , =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Han-Wen Nienhuys Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Dec 24, 2021 at 5:16 AM Junio C Hamano wrote: > Once you > initialize at the declaration with "less meaningful" value (like > zero initialization), the tools won't be able to tell when the code > uses that variable "uninitialized" (because the assignment was > skipped by a bug), since it appears to always be initialied to them. Which tools are these? When I add static void test_memcpy(void) { uint32_t dest; char not_init[200]; int i; memcpy(&dest, not_init, sizeof(dest)); for (i =3D 0 ; i < 10; i++) not_init[i] =3D rand() % 255 + 1; printf("%d", (int) strlen(not_init)); } to the C code, it compiles cleanly if I do "make DEVELOPER=3D1". --=20 Han-Wen Nienhuys - Google Munich I work 80%. Don't expect answers from me on Fridays. -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado