Re: Public repro case! Re: [PATCH/RFC] Allow writing loose objects that are corrupted in a pack file
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jan 8, 2009, 03:01 UTC
- Message-ID
- <20090108030115.GF10790@spearce.org>
- In-Reply-To
- <alpine.LFD.2.00.0901071836290.3283@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 16 quoted lines
> On Wed, 7 Jan 2009, R. Tyler Ballance wrote: > > > > tyler@grapefruit:~/source/git/linux-2.6> git pull > > error: failed to read object be1b87c70af69acfadb8a27a7a76dfb61de92643 at offset 1850923 > > from .git/objects/pack/pack-dbe154052997a05499eb6b4fd90b924da68e799a.pack > > fatal: object be1b87c70af69acfadb8a27a7a76dfb61de92643 is corrupted > > Btw, this is an interesting error message, mostly because of what is > _not_ there. > > In particular, it doesn't report any reason _why_ it failed to read the > object, which as far as I can tell can happen for only one reason: > unpack_compressed_entry() returns NULL, and that path is the only thing > that can do so without a message. > > And it only does it if zlib fails.
Ok, well, in this case I've been able to reproduce a zlib inflate failure on the base object in a 2 deep delta chain. We got back:
#define Z_STREAM_ERROR (-2)
this causes the buffer to be freed and NULL to come back out of unpack_compressed_entry(), and then everything is corrupt...
-- Shawn.