From: Jeff King <firstname.lastname@example.org> To: email@example.com Cc: Eric Sunshine <firstname.lastname@example.org> Subject: Re: [PATCH 0/6] more small leak fixes Date: Fri, 14 Aug 2020 12:27:49 -0400 [thread overview] Message-ID: <20200814162749.GB595840@coredump.intra.peff.net> (raw) In-Reply-To: <20200814162525.GA595840@coredump.intra.peff.net> On Fri, Aug 14, 2020 at 12:25:25PM -0400, Jeff King wrote: > On Fri, Aug 14, 2020 at 12:13:28PM -0400, Jeff King wrote: > > > Based on the discussion over in , I wondered how close we were to > > being able to run some test scripts with a leak-checker like LSan not > > complaining. The answer is...not close. > > > > I picked t5526 more or less at random (it was the first failure when I > > did a parallel "make test") to see what it would take to get it passing. > > After much effort...I have t5526.1, the setup test, running clean. :) > > For reference, here are the UNLEAK() calls I had to add to silence the > false positives. Some of these are kind of sketchy. For example, > declaring that wt_status_collect_changes_index() is allowed to leak is a > bit low-level for my tastes (in general it's probably only called once > per program, but it's getting quite far from the bottom of the stack). > But there's actually no convenient way to free the various bits of a > rev_info, so marking it with UNLEAK() is an expedient hack. And by the way, having gone through this exercise, I'm re-convinced that UNLEAK() is reasonable to keep. A lot of these cases would have been very awkward with free(). Not insurmountable, but cases where a variable is sometimes-allocated and sometimes-not get rather tricky. -Peff
next prev parent reply other threads:[~2020-08-14 16:27 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-14 16:13 Jeff King 2020-08-14 16:14 ` [PATCH 1/6] submodule--helper: use strbuf_release() to free strbufs Jeff King 2020-08-14 16:14 ` [PATCH 2/6] checkout: fix leak of non-existent branch names Jeff King 2020-08-14 16:17 ` [PATCH 3/6] config: fix leaks from git_config_get_string_const() Jeff King 2020-08-14 16:19 ` [PATCH 4/6] config: drop git_config_get_string_const() Jeff King 2020-08-14 20:21 ` Junio C Hamano 2020-08-15 6:34 ` Jeff King 2020-08-17 17:36 ` Junio C Hamano 2020-08-14 16:19 ` [PATCH 5/6] config: fix leak in git_config_get_expiry_in_days() Jeff King 2020-08-14 16:20 ` [PATCH 6/6] submodule--helper: fix leak of core.worktree value Jeff King 2020-08-14 16:25 ` [PATCH 0/6] more small leak fixes Jeff King 2020-08-14 16:27 ` Jeff King [this message] 2020-08-17 21:32 ` [PATCH v2 0/7] " Jeff King 2020-08-17 21:33 ` [PATCH v2 1/7] clear_pattern_list(): clear embedded hashmaps Jeff King 2020-08-17 21:33 ` [PATCH v2 2/7] submodule--helper: use strbuf_release() to free strbufs Jeff King 2020-08-17 21:33 ` [PATCH v2 3/7] checkout: fix leak of non-existent branch names Jeff King 2020-08-17 21:33 ` [PATCH v2 4/7] config: fix leaks from git_config_get_string_const() Jeff King 2020-08-17 21:33 ` [PATCH v2 5/7] config: drop git_config_get_string_const() Jeff King 2020-08-17 21:33 ` [PATCH v2 6/7] config: fix leak in git_config_get_expiry_in_days() Jeff King 2020-08-17 21:33 ` [PATCH v2 7/7] submodule--helper: fix leak of core.worktree value Jeff King
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=20200814162749.GB595840@coredump.intra.peff.net \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH 0/6] more small leak fixes' \ /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).