git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Andrzej Hunt <andrzej@ahunt.org>
To: Derrick Stolee <stolee@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Andrzej Hunt via GitGitGadget <gitgitgadget@gmail.com>,
	Derrick Stolee <dstolee@microsoft.com>,
	Abhishek Kumar <abhishekkumar8222@gmail.com>,
	Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Andrzej Hunt <ajrhunt@google.com>
Subject: Re: [PATCH] commit-graph: avoid leaking topo_levels slab in write_commit_graph()
Date: Mon, 22 Feb 2021 20:14:15 +0100	[thread overview]
Message-ID: <dfc713c2-c5f6-6c7f-230b-810da0e39ebf@ahunt.org> (raw)
In-Reply-To: <6ef5487b-905d-8f34-a53c-d1138f5528d9@gmail.com>

On 22/02/2021 15:15, Derrick Stolee wrote:
> This change looks like a sane change to me. It definitely fixes a leak.
> The leak "wasn't hurting anybody" because write_commit_graph() is only
> called at most once per process, and the process closes itself out
> shortly after. Still, it's good to have good memory hygiene here.

Good to know - thank you! As I become more familiar with git, I'm 
beginning to realise that most leaks are unlikely to be much importance 
(even though I personally err on the side of fixing any and all issues).


One thing I forgot to mention: in this specific case the leak was 
causing a build failure when trying to build git's fuzzers within 
oss-fuzz locally*. Specifically the following command would fail (see 
also fuzz failure reproduction instructions which describe the setup [1]).

  $ python infra/helper.py build_fuzzers --sanitizer address git

As far as I can tell the issue is that: a copy of git built with ASAN is 
used to produce the fuzzing corpus as part of the git-specific build 
script [2] - the leak warning causes the script to fail. (It's possible 
to argue that the build script should disable ASAN's leak checking when 
running git, via detect_leaks=0 to reduce the risk of such breakage - I 
may try to suggest such a change to oss-fuzz.)

ATB,
   Andrzej


* Given that oss-fuzz is building via docker, I would intuitively 
suspect that the same issue occurs in automation - I'm not sure how to 
verify this myself.

[1] 
https://google.github.io/oss-fuzz/advanced-topics/reproducing/#building-using-docker
[2] 
https://github.com/google/oss-fuzz/blob/1b0115eefd70491376cf3cb6f88e49632c78ee18/projects/git/build.sh#L37

  reply	other threads:[~2021-02-22 19:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 20:13 Andrzej Hunt via GitGitGadget
2021-02-20  3:36 ` Junio C Hamano
2021-02-22 14:15   ` Derrick Stolee
2021-02-22 19:14     ` Andrzej Hunt [this message]
2021-02-25  6:26 Abhishek Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfc713c2-c5f6-6c7f-230b-810da0e39ebf@ahunt.org \
    --to=andrzej@ahunt.org \
    --cc=abhishekkumar8222@gmail.com \
    --cc=ajrhunt@google.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=stolee@gmail.com \
    --subject='Re: [PATCH] commit-graph: avoid leaking topo_levels slab in write_commit_graph()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).