From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] remote: plug memory leaks
Date: Sat, 25 Jul 2026 10:06:12 -0700 [thread overview]
Message-ID: <xmqq1pcryp6j.fsf@gitster.g> (raw)
In-Reply-To: <20260725161819.GA2343104@coredump.intra.peff.net> (Jeff King's message of "Sat, 25 Jul 2026 12:18:19 -0400")
Jeff King <peff@peff.net> writes:
> We should not rely on that assumption, because we sometimes discard the
> configset (e.g., when discovering the repo, or when writing a new config
> option). I couldn't come up with a case that fails, but I think it is
> mostly luck (or lack of imagination) that there is no code path that
> invalidates the configset between when we read the remote config and
> when we actually use it.
>
> So even though in something like:
>
> git -c url.$PWD.insteadOf=$PWD clone $PWD dst
>
> we end up with a state were the instead-of structs are broken, nobody is
> reading them at that point.
>
> So I think this v2 is doing the right thing.
Thanks.
I had somebody else dig into the entire codebase and they claim that
there is only one existing (ab)user of the configuration API that
assumes that the configset-held strings will stay forever, which is
the comment_line_string stuff that is stored from the configuration
callback without getting copied. I do not necessarily believe it is
the only one, but this particular code indeed seems to rely on the
assumption. #leftoverbits perhaps.
prev parent reply other threads:[~2026-07-25 17:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 0:43 [PATCH] remote: plug memory leaks Junio C Hamano
2026-07-25 1:57 ` Junio C Hamano
2026-07-25 16:03 ` [PATCH v2] " Junio C Hamano
2026-07-25 16:18 ` Jeff King
2026-07-25 17:06 ` Junio C Hamano [this message]
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=xmqq1pcryp6j.fsf@gitster.g \
--to=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.