Re: fatal: serious inflate inconsistency
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jun 8, 2007, 17:01 UTC
- Message-ID
- <alpine.LFD.0.98.0706080959570.4205@woody.linux-foundation.org>
- In-Reply-To
- <20070608153722.GL2335@cip.informatik.uni-erlangen.de>
On Fri, 8 Jun 2007, Thomas Glanzmann wrote:
> > yes, it is reproducable. Again I am off the net for an hour.
Could you compile your own git? If so, please try this patch on top of current git, to make the error message a bit more informative.
It does sound like a corrupt stream, but maybe debian has some strange zlib version that git doesn't like.
Linus --- index-pack.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/index-pack.c b/index-pack.c index 82c8da3..542687b 100644 --- a/index-pack.c +++ b/index-pack.c @@ -277,9 +277,13 @@ static void *get_data_from_pack(struct object_entry *obj) stream.avail_in = len; inflateInit(&stream); while ((st = inflate(&stream, Z_FINISH)) == Z_OK); + if (st != Z_STREAM_END) + die("serious inflate inconsistency: %d (%s)", + st, stream.msg ? stream.msg : "no message"); + if (stream.total_out != obj->size) + die("serious inflate inconsistency: got %lu bytes, expected %lu", + stream.total_out, obj->size); inflateEnd(&stream); - if (st != Z_STREAM_END || stream.total_out != obj->size) - die("serious inflate inconsistency"); free(src); return data; }