git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Jeff King <peff@peff.net>
Cc: "D. Ben Knoble" <ben.knoble@gmail.com>,
	Emily M Klassen <forivall@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] revision: fix missing null for freed memory
Date: Wed, 12 Feb 2025 06:30:01 +0100	[thread overview]
Message-ID: <Z6wx2a4LUcOjU79p@pks.im> (raw)
In-Reply-To: <20250211212909.GA3113114@coredump.intra.peff.net>

On Tue, Feb 11, 2025 at 04:29:09PM -0500, Jeff King wrote:
> On Tue, Feb 11, 2025 at 03:22:28PM -0500, D. Ben Knoble wrote:
> 
> > 2.{30,35}.0 fails to recognize --no-graph, so I checked "git log --grep no-graph
> > origin/master" with "git describe --contains" and decided that 2.36.0 was first
> > release recognizing --no-graph, but it didn't build for me (possibly an issue on
> > my end). I got 2.37.0 built, and it was "good," so that's where I started.
> > 
> > Here's my "bisect run" script.
> > 
> >     #! /bin/sh -x
> >     make || exit 125
> >     # segfault has exit >128
> >     ./bin-wrappers/git --no-pager log -2 --graph --no-graph --patch
> > --cc || exit 1
> 
> I don't think this is quite enough. The problem is a use-after-free, so
> the behavior is undefined. Depending on whether that heap block is
> reused, it might work just fine, or output garbage data, or segfault.
> 
> I'd have _thought_ it would usually just segfault, but it almost always
> just output garbage for me. Building with:
> 
>   make SANITIZE=address,undefined
> 
> is a good way to get reliable results for this kind of memory error.
> Doing that shows that v2.37.0 is actually bad. And bisecting shows that
> it has been broken since 087c745833 (log: add a --no-graph option,
> 2022-02-11), which is not too surprising.

Thanks all for bisecting :)

Patrick

  parent reply	other threads:[~2025-02-12  5:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-08  6:17 [PATCH] revision: fix missing null for freed memory Emily M Klassen
2025-02-08 21:53 ` Junio C Hamano
2025-02-10 16:02 ` Junio C Hamano
2025-02-10 20:56   ` Emily Klassen
2025-02-13  0:42     ` Junio C Hamano
2025-02-11  7:55 ` Patrick Steinhardt
2025-02-11 19:31   ` D. Ben Knoble
2025-02-11 20:22     ` D. Ben Knoble
2025-02-11 21:29       ` Jeff King
2025-02-11 23:09         ` Junio C Hamano
2025-02-12  5:30         ` Patrick Steinhardt [this message]
2025-02-13 21:07         ` Ben Knoble

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=Z6wx2a4LUcOjU79p@pks.im \
    --to=ps@pks.im \
    --cc=ben.knoble@gmail.com \
    --cc=forivall@gmail.com \
    --cc=git@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).