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

[BUG] git rev-list --missing=allow-promisor

From
Andrew Olsen <andrew.olsen@koordinates.com>
Date
Aug 10, 2022, 21:33 UTC
Message-ID
<CAPJmHpVssKshapGYDF-ifU1fts-jFTC-HqxnjN8meSMP3weB4g@mail.gmail.com>
Steps to reproduce:
1. Create a git repository with missing+promised blobs.
For example, I did this:
git clone git@github.com:git/git.git git-no-blobs --filter=blob:none
--depth=1 --bare

--filter=blob:none - don't fetch any blobs --depth=1 - we don't need git's entire history, just one commit is fine --bare - this avoids git fetching any blobs as part of the checkout operation

2. In this repository, run:
git rev-list HEAD --objects --missing=allow-promisor

Expected outcome: git rev-list prints the paths and OIDs of all the objects

Actual outcome: Any of the following: a) git rev-list prints the paths and OIDs of all the objects b) git rev-list fails with "fatal: malformed mode in tree entry" c) git rev-list fails with "fatal: too-short tree object"

Diagnosis: With missing=allow-promisor, when git encounters a missing object, it calls is_promisor on it, which in turn calls add_promisor_object on lots of things. In this line in add_promisor_object, the buffer of the tree that we are currently traversing is freed: https://github.com/git/git/blob/master/packfile.c#L2242 This clearly causes problems but not in a deterministic way.

Next: Jeff King
Message 1 of 5 in “[BUG] git rev-list --missing=allow-promisor”
  1. Andrew OlsenAug 10, 2022
  2. Jeff KingAug 11, 2022
  3. is_promisor_object(): fix use-after-free of tree bufferJeff King, Aug 14, 2022
  4. Junio C HamanoAug 15, 2022
  5. Jeff KingAug 15, 2022

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.