Re: pack corruption post-mortem
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 19, 2013, 10:32 UTC
- Message-ID
- <CACsJy8ABdE8mZMVFZkqYMC4ZeN_baWw=XcYOZYBCZytWP97rRw@mail.gmail.com>
- In-Reply-To
- <20131016083400.GA31266@sigill.intra.peff.net>
On Wed, Oct 16, 2013 at 3:34 PM, Jeff King <peff@peff.net> wrote:
Show 15 quoted lines
> I was recently presented with a repository with a corrupted packfile, > and was asked if the data was recoverable. This post-mortem describes > the steps I took to investigate and fix the problem. I thought others > might find the process interesting, and it might help somebody in the > same situation. > > I started with an fsck, which found a problem with exactly one object > (I've used $pack and $obj below to keep the output readable, and also > because I'll refer to them later): > > $ git fsck > error: $pack SHA1 checksum mismatch > error: index CRC mismatch for object $obj from $pack at offset 51653873 > error: inflate: data stream error (incorrect data check) > error: cannot unpack $obj from $pack at offset 51653873
I wonder if we should protect the sha-1 and pathname tables in packv4 with CRC too. A bit flipped in there could cause stream of corrupt objects and make it hard to pinpoint the corrupt location..
-- Duy