git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] format-patch: fix leak of rev_info in prepare_bases()

From
Patrick Steinhardt <ps@pks.im>
Date
Jul 6, 2026, 05:57 UTC
Message-ID
<aktD0fioUvyebhOY@pks.im>
In-Reply-To
<20260706003429.GD2301945@coredump.intra.peff.net>
On Sun, Jul 05, 2026 at 08:34:29PM -0400, Jeff King wrote:
Show 29 quoted lines
> 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
Previous: Jeff KingNext: Karthik Nayak
Message 13 of 15 in “small leak fix in format-patch”
  1. 0/2 small leak fix in format-patchJeff King, Jun 30, 2026
  2. 1/2 t: move LSan errors from stdout to stderrJeff King, Jun 30, 2026
  3. 2/2 format-patch: fix leak of rev_info in prepare_bases()Jeff King, Jun 30, 2026
  4. Patrick SteinhardtJun 30, 2026
  5. Jeff KingJul 1, 2026
  6. Patrick SteinhardtJul 1, 2026
  7. Jeff KingJul 1, 2026
  8. Patrick SteinhardtJul 1, 2026
  9. Jeff KingJul 2, 2026
  10. Patrick SteinhardtJul 2, 2026
  11. Junio C HamanoJul 3, 2026
  12. Jeff KingJul 6, 2026
  13. Patrick SteinhardtJul 6, 2026
  14. Karthik NayakJul 4, 2026
  15. Jeff KingJul 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.