git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH] t4204 is not sanitizer clean at all
Date: Fri, 17 Dec 2021 05:39:04 +0100	[thread overview]
Message-ID: <211217.861r2bal75.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqtuf86t7z.fsf_-_@gitster.g>


On Thu, Dec 16 2021, Junio C Hamano wrote:

> Earlier we marked that this patch-id test is leak-sanitizer clean,
> but if we read the test script carefully, it is merely because we
> have too many invocations of commands in the "git log" family on the
> upstream side of the pipe, hiding breakages from them.
>
> Split the pipeline so that breakages from these commands can be
> caught (not limited to aborts due to leak-sanitizer) and unmark
> the script as not passing the test with leak-sanitizer in effect.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
>  A quick grep tells me that tests 3302, 3303, 3305, 4020 and 6236
>  all use "git log" and still are marked as passing tests with
>  leak-sanitizer in effect.  I've taken a deep look at none of them,
>  but I suspect they share the same kind of breakage.

This change looks good to me.

FWIW this is not a mistake on my part, but something I'm perfectly aware
of. I don't consider it to be "brekage".

We have plenty of place in the test suite where we hide exit codes on
the LHS of a pipe, or where we call a function that doesn't &&-chain its
git invocations.

In those cases we can and usually will "succeed" under LSAN, because it
allows the program to emit its full output, and will abort() at the very
end.

I have an unsubmitted logging mode (using LSAN_OPTIONS=log_path=<path>)
where I log every one of these to test-results/*, there's a lot more of
these.

But in the meantime I think the best way forward is to gradually mark
the tests that pass with LSAN as passing, to ensure that we at least
don't have regressions in the meantime. Before this we'd at least check
the "git checkout" etc. for leaks.

If I made fixing all broken &&-chains or git on the LHS of a pipe a
prerequisite for marking as passing under under LSAN I'd end up with
something that's approximately the size of [1] and more (i.e. Eric's
upcoming patches to do that).

I don't see why we'd consider perfect the enemy of the good in these
cases. Yes we won't catch the successful exit of every single git
invocation, but our tests aren't doing that now, LSAN or not. But until
that's fixed we'll at least catch some, which helps our overall memory
leak regression coverage.

More importantly it makes it a lot easier to reason about future memory
leak patches, as we'll be able to get to a 1=1 mapping of tests that
pass, and those that are marked being known to pass. I'm using that
locally to fake-fail those that start passing unexpectedly that aren't
on the list, which then helps to inform the addition of "this test now
passes with no leaks".

1. https://lore.kernel.org/git/20211213063059.19424-1-sunshine@sunshineco.com/

  reply	other threads:[~2021-12-17  4:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 22:03 [PATCH V3 1/2] git-apply: add --quiet flag Jerry Zhang
2021-12-13 22:03 ` [PATCH V5 2/2] git-apply: add --allow-empty flag Jerry Zhang
2021-12-16  1:40   ` Junio C Hamano
2021-12-16 23:11     ` [PATCH] t4204 is not sanitizer clean at all Junio C Hamano
2021-12-17  4:39       ` Ævar Arnfjörð Bjarmason [this message]
2021-12-17 20:48         ` Junio C Hamano
2021-12-17 22:23           ` Ævar Arnfjörð Bjarmason
2021-12-16 23:37     ` [PATCH] format-patch: mark rev_info with UNLEAK Junio C Hamano
2021-12-17  4:51     ` [PATCH V5 2/2] git-apply: add --allow-empty flag Ævar Arnfjörð Bjarmason
2021-12-17 20:48       ` Junio C Hamano
2021-12-17 22:28         ` Ævar Arnfjörð Bjarmason
2021-12-17 22:32         ` Junio C Hamano
2021-12-13 22:30 ` [PATCH V3 1/2] git-apply: add --quiet flag Junio C Hamano

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=211217.861r2bal75.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).