From: Taylor Blau <me@ttaylorr•com>
To: Jonas Haag <jonas@lophus•org>
Cc: "brian m. carlson" <sandals@crustytoothpaste•net>, git@vger•kernel.org
Subject: Re: Infinite loop + memory leak in annotate_refs_with_symref_info
Date: Tue, 11 Apr 2023 16:25:13 -0400 [thread overview]
Message-ID: <ZDXCKecwxo36fALm@nand.local> (raw)
In-Reply-To: <39035D34-8548-44B0-BBBB-5C36B3876C4A@lophus.org>
Hi Jonas,
On Tue, Apr 11, 2023 at 10:53:59PM +0300, Jonas Haag wrote:
> Hello!
>
> There is an infinite loop with an accompanying memory leak in
> annotate_refs_with_symref_info that was introduced in Git 2.28 (I
> think in commit 2c6a403: “connect: add function to parse multiple v1
> capability values”).
I'm not familiar with Klaus and don't have it installed, but a couple of
questions: were you able to reproduce this result with any other forges
or tools, and were you able to confirm that 2c6a403 is the culprit via a
bisection?
In case the answer to the latter question is "yes", I cc'd brian carlson
on this thread, since they are the original author of that patch.
> I believe the bug in Git is in connect.c, function
> parse_feature_value, in the updating of `*offset`: It doesn’t seem to
> take into account that `feature_list` has already been offset by
> `*offset`. I believe the update needs to use `*offset +=` instead of
> `*offset =`. When I make this change, the infinite loop seems to go
> away, and cloning via Klaus/Dulwich will fail with “invalid index-pack
> output”. Cloning from github.com works, although I’m not sure if
> that’s a relevant smoke test in this case.
I'm not sure I understand. Looking at the relevant bits in
connect.c::parse_feature_value(), it all seems correct to me, since the
beginning of `feature_list` is adjusted by the current value of
`*offset`.
> [1] https://github.com/jonashaag/klaus
Thanks,
Taylor
next prev parent reply other threads:[~2023-04-11 20:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 19:53 Infinite loop + memory leak in annotate_refs_with_symref_info Jonas Haag
2023-04-11 20:25 ` Taylor Blau [this message]
2023-04-11 23:59 ` Taylor Blau
2023-04-12 0:53 ` brian m. carlson
2023-04-11 21:06 ` Jeff King
2023-04-11 21:16 ` Jeff King
2023-04-11 21:22 ` Taylor Blau
2023-04-11 21:58 ` Jeff King
2023-04-11 22:52 ` Junio C Hamano
2023-04-12 6:23 ` [PATCH 0/7] v0 multiple-symref infinite loop fix and test cleanup Jeff King
2023-04-12 6:29 ` [PATCH 1/7] v0 protocol: fix infinite loop when parsing multi-valued capabilities Jeff King
2023-04-12 6:46 ` Jeff King
2023-04-12 7:25 ` [PATCH v2 " Jeff King
2023-04-12 7:26 ` Jeff King
2023-04-12 6:29 ` [PATCH 2/7] t5512: stop referring to "v1" protocol Jeff King
2023-04-12 6:31 ` [PATCH 3/7] t5512: stop using jgit for capabilities^{} test Jeff King
2023-04-12 9:04 ` Jeff King
2023-04-14 21:24 ` [PATCH v3 0/7] v0 multiple-symref infinite loop fix and test cleanup Jeff King
2023-04-14 21:24 ` [PATCH v3 1/7] v0 protocol: fix infinite loop when parsing multi-valued capabilities Jeff King
2023-04-14 21:24 ` [PATCH v3 2/7] t5512: stop referring to "v1" protocol Jeff King
2023-04-14 21:25 ` [PATCH v3 3/7] v0 protocol: fix sha1/sha256 confusion for capabilities^{} Jeff King
2023-04-14 21:25 ` [PATCH v3 4/7] t5512: add v2 support for "ls-remote --symref" test Jeff King
2023-04-14 21:25 ` [PATCH v3 5/7] t5512: allow any protocol version for filtered symref test Jeff King
2023-04-14 21:25 ` [PATCH v3 6/7] t5512: test "ls-remote --heads --symref" filtering with v0 and v2 Jeff King
2023-04-14 21:25 ` [PATCH v3 7/7] v0 protocol: use size_t for capability length/offset Jeff King
2023-04-17 16:06 ` [PATCH v3 0/7] v0 multiple-symref infinite loop fix and test cleanup Junio C Hamano
2023-04-12 6:34 ` [PATCH 4/7] t5512: add v2 support for "ls-remote --symref" test Jeff King
2023-04-12 6:35 ` [PATCH 5/7] t5512: allow any protocol version for filtered symref test Jeff King
2023-04-12 6:37 ` [PATCH 6/7] t5512: test "ls-remote --heads --symref" filtering with v0 and v2 Jeff King
2023-04-12 6:40 ` [PATCH 7/7] v0 protocol: use size_t for capability length/offset 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=ZDXCKecwxo36fALm@nand.local \
--to=me@ttaylorr$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jonas@lophus$(echo .)org \
--cc=sandals@crustytoothpaste$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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