From: Shawn Pearce <firstname.lastname@example.org> To: Nicolas Pitre <email@example.com> Cc: Duy Nguyen <firstname.lastname@example.org>, Git Mailing List <email@example.com>, Jeff King <firstname.lastname@example.org> Subject: Re: pack corruption post-mortem Date: Sat, 19 Oct 2013 12:17:52 -0700 [thread overview] Message-ID: <CAJo=hJugNGkpDxh6o6azVGc7pP3fTGsK113vRgb4A7ipNeV2ZA@mail.gmail.com> (raw) In-Reply-To: <alpine.LFD.email@example.com> On Sat, Oct 19, 2013 at 7:41 AM, Nicolas Pitre <firstname.lastname@example.org> wrote: > On Sat, 19 Oct 2013, Duy Nguyen wrote: > >> On Wed, Oct 16, 2013 at 3:34 PM, Jeff King <email@example.com> wrote: >> > 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.. > > It turns out that we already have this covered. > > The SHA1 used in the name of the pack file is actually the SHA1 checksum > of the SHA1 table. I continue to believe this naming is wrong. The pack file name should be the SHA1 checksum of the pack data stream, but the SHA1 table. This would allow cleaner update of a repository that was repacked with different compression settings, but identical objects.
next prev parent reply other threads:[~2013-10-19 19:18 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-10-16 8:34 Jeff King 2013-10-16 8:59 ` Duy Nguyen 2013-10-16 15:41 ` Martin Fick 2013-10-17 0:35 ` Jeff King 2013-10-17 15:47 ` Junio C Hamano 2013-10-25 7:55 ` Jeff King 2013-10-17 1:06 ` Duy Nguyen 2013-10-19 10:32 ` Duy Nguyen 2013-10-19 14:41 ` Nicolas Pitre 2013-10-19 19:17 ` Shawn Pearce [this message] 2013-10-20 20:56 ` Nicolas Pitre 2013-10-20 4:44 ` Duy Nguyen 2013-10-20 21:08 ` Nicolas Pitre 2015-04-01 21:08 ` [PATCH] howto: document more tools for recovery corruption Jeff King 2015-04-01 22:21 ` Junio C Hamano 2015-04-02 0:49 ` Jeff King
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style List information: http://vger.kernel.org/majordomo-info.html * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAJo=hJugNGkpDxh6o6azVGc7pP3fTGsK113vRgb4A7ipNeV2ZA@mail.gmail.com' \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --subject='Re: pack corruption post-mortem' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Code repositories for project(s) associated with this inbox: https://80x24.org/mirrors/git.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).