Thread (5 messages) 5 messages, 3 authors, 2022-08-16

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

From: Andrew Olsen <hidden>
Date: 2022-08-10 21:34:11

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help