Git development
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Karthik Nayak <karthik.188@gmail.com>
Subject: Re: [PATCH 2/2] format-patch: fix leak of rev_info in prepare_bases()
Date: Mon, 6 Jul 2026 07:57:37 +0200	[thread overview]
Message-ID: <aktD0fioUvyebhOY@pks.im> (raw)
In-Reply-To: <20260706003429.GD2301945@coredump.intra.peff.net>

On Sun, Jul 05, 2026 at 08:34:29PM -0400, Jeff King wrote:
> On Fri, Jul 03, 2026 at 01:45:15PM -0700, Junio C Hamano wrote:
> 
> > Patrick Steinhardt <ps@pks.im> writes:
> > 
> > >> Likewise I find the dual clang/gcc jobs to be overkill. Compiling with
> > >> both is useful, as they have different warnings. But have we ever seen a
> > >> case where running the tests showed a different result with different
> > >> compilers?
> > >
> > > Not that I'd know of. As you say, I think it makes sense to use
> > > different compilers in general. But I don't really think we need to have
> > > this as a full "compiler x tests" matrix.
> > 
> > Very true.  Different configurations with TEST-vars are great
> > combination to test, but we are not in the business of hunting bugs
> > in clang/gcc so we long as they compile (instead of warning "hey,
> > that construct gives you undefined behaviour"), we shouldn't have to
> > run the test suite with the same configuration for both.
> 
> I don't care about finding bugs in clang vs gcc. I'm more concerned with
> a case where we have undefined behavior, both compile it fine, but the
> bad behavior is revealed in the tests only by one of them.
> 
> I can think offhand of only one case where I saw that happen[1]. IIRC it
> had to do with integer sizes being passed to a variadic function. But it
> also changed behavior within the same compiler using different
> optimization levels. So it feels like kind of a scattershot way of
> trying to flush out UB, and we are probably better off with UBSan and
> friends.

Yes, I just wanted to say that UBSan is definitely the better way to go
in this context. I have no idea of course whether it would have catched
the mentioned issue, though.

And even so, we'd have at least one job that runs all tests with either
of the compilers, so we'd still notice issues like that.

Patrick

  reply	other threads:[~2026-07-06  5:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  6:39 [PATCH 0/2] small leak fix in format-patch Jeff King
2026-06-30  6:41 ` [PATCH 1/2] t: move LSan errors from stdout to stderr Jeff King
2026-06-30  6:43 ` [PATCH 2/2] format-patch: fix leak of rev_info in prepare_bases() Jeff King
2026-06-30 10:26   ` Patrick Steinhardt
2026-07-01  8:13     ` Jeff King
2026-07-01  8:42       ` Patrick Steinhardt
2026-07-01  8:47         ` Jeff King
2026-07-01  9:01           ` Patrick Steinhardt
2026-07-02  8:58             ` Jeff King
2026-07-02 10:08               ` Patrick Steinhardt
2026-07-03 20:45                 ` Junio C Hamano
2026-07-06  0:34                   ` Jeff King
2026-07-06  5:57                     ` Patrick Steinhardt [this message]
2026-07-04 21:13 ` [PATCH 0/2] small leak fix in format-patch Karthik Nayak
2026-07-06  0:01   ` 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

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

  git send-email \
    --in-reply-to=aktD0fioUvyebhOY@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    --cc=peff@peff.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox