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=-10.8 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 BDBF71F4D7 for ; Tue, 14 Jun 2022 22:38:56 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="q13RV7B9"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353064AbiFNWiy (ORCPT ); Tue, 14 Jun 2022 18:38:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352978AbiFNWiw (ORCPT ); Tue, 14 Jun 2022 18:38:52 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A96B50E0C for ; Tue, 14 Jun 2022 15:38:52 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id f8so8904317plo.9 for ; Tue, 14 Jun 2022 15:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=Q1rtPQRmuZW2Z2V71M4vT/XQ5X26GD45vG8iiVI4KRM=; b=q13RV7B90yQjCskBBE/rQ8QJAn6H7Uw7YtMubNgw37bqv4xCu+igbIFbMA4q1fzi/X CZGm/1GpniiHxyhAt7pQmcXnkIC0zWybWFe2ndVHVNwOlttOralYwMz+TDnwHijVjCsW uKQnsvQrpBes2eD2PFp7vaKcHsWVbErTE8ovQMZf8LgO5mLITj4+O7pUzMcthBFxixih UyXAjzoeIwSK2/nr0Mp+WrFzPHTwvcT/8UcLv2PE3NgvqeFTxaV4IF8x+KKfLEKnRRSx v1+6KHD/MaH5YEUSSLK6SwyTsapaSMfbFVZlCA0lNe6VHgvgIVuYsN5pGQPVtgQm6Jag YNXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Q1rtPQRmuZW2Z2V71M4vT/XQ5X26GD45vG8iiVI4KRM=; b=rxgw0YBayrxvM1ChtBncdigIztI6i1kxs2iSZMDthdFNtEHDRG4YSnlqE5Ci8Q7XGI mdEoSV/1nXkEr9b+WtoP/sZrfCDxbDt6ngjcZWs9gzwnElxxhVGvnyXiN+KN+G7iVdJw gziVxHVzmxiK07i2if32D2PDAitmH+6iHhFKLMbiLmYhE+MwQvDYu8KlJNG9LVV07VMt r9apy9BaFVzcR/XXA+uEjnb4BHInafccpCuql25l31B5dD6MorLnKiKR+U+sud+KvgVd Pbz0l0k2AcQ6qVgwqw674StKE191DHKMkn0Ba52T9uLgp+YtFKEjX8s3PpotpNuEJpX1 J+mA== X-Gm-Message-State: AJIora9ZkoRahPPZzhs+ws169lx800t8XUH/NekjQh5YIFjjrsN3YIE0 Va5sqUXsZCOgn7ilRENvTJnAsQ== X-Google-Smtp-Source: AGRyM1u29oYhATJQs9I7vbq+VGSP39K5NKWQUf4fN6o6bH8zVpUhyvuLGRVPA23daO4eCn7seps85A== X-Received: by 2002:a17:902:d2d0:b0:168:b0b2:f068 with SMTP id n16-20020a170902d2d000b00168b0b2f068mr6174931plc.45.1655246331686; Tue, 14 Jun 2022 15:38:51 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:2875:8d7a:3bc6:3cab]) by smtp.gmail.com with ESMTPSA id e8-20020a170902784800b001645730e71bsm7776559pln.59.2022.06.14.15.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 15:38:51 -0700 (PDT) Date: Tue, 14 Jun 2022 15:38:44 -0700 From: Josh Steadmon To: Jonathan Tan Cc: git@vger.kernel.org, me@ttaylorr.com, derrickstolee@github.com, lessleydennington@gmail.com, gitster@pobox.com, vdye@github.com, avarab@gmail.com Subject: Re: [RFC PATCH v2] commit-graph: refactor to avoid prepare_repo_settings Message-ID: Mail-Followup-To: Josh Steadmon , Jonathan Tan , git@vger.kernel.org, me@ttaylorr.com, derrickstolee@github.com, lessleydennington@gmail.com, gitster@pobox.com, vdye@github.com, avarab@gmail.com References: <2c2bfc7b43c92dc7c0a4c47a2c88dadeb39c763b.1649486398.git.steadmon@google.com> <20220607200231.1958109-1-jonathantanmy@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220607200231.1958109-1-jonathantanmy@google.com> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 2022.06.07 13:02, Jonathan Tan wrote: > Josh Steadmon writes: > > diff --git a/fuzz-commit-graph.c b/fuzz-commit-graph.c > > index e7cf6d5b0f..e53a2635f6 100644 > > --- a/fuzz-commit-graph.c > > +++ b/fuzz-commit-graph.c > > @@ -11,7 +11,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) > > struct commit_graph *g; > > > > initialize_the_repository(); > > - g = parse_commit_graph(the_repository, (void *)data, size); > > + /* > > + * Manually initialize commit-graph settings, to avoid the need to run > > + * in an actual repository. > > + */ > > + the_repository->settings.commit_graph_generation_version = 2; > > + the_repository->settings.commit_graph_read_changed_paths = 1; > > + g = parse_commit_graph_settings(&the_repository->settings, (void *)data, size); > > repo_clear(the_repository); > > free_commit_graph(g); > > The comment doesn't explain why we need to avoid an actual repository. Maybe > better: Initialize the commit-graph settings that would normally be read from > the repository's gitdir. > > Other than that, this patch looks good to me. Isolating a part of the > commit graph mechanism that can be fuzzed without access to the disk is, > I think, a good idea, and this patch is a good way to do it. Done in V3, thanks for taking a look!