git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [JGit] Mismatch CRC in packed objects from `jgit push`
@ 2009-03-24  2:53 Daniel Cheng
  2009-03-24 11:13 ` [JGIT Test Case] This (incomplete) test case demo the index wrong CRC bug Daniel Cheng (aka SDiZ)
  2009-03-25  6:21 ` [PATCH JGIT 1/2] Calculate CRC32 on Pack Index v2 Daniel Cheng (aka SDiZ)
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Cheng @ 2009-03-24  2:53 UTC (permalink / raw)
  To: git

Hi list,

When I working with jgit-over-freenet, I found the pack files as
generated by `jgit push` give CRC error in `git fsck` and `git clone`,
but they are perfectly okay if I do a `git unpack-objects` manually.

You can download the pack file here:
 http://sdiz.net/temp/pack-fcedfaa7130866c884e208769661360563a3081f.idx
 http://sdiz.net/temp/pack-fcedfaa7130866c884e208769661360563a3081f.pack


Here is the diagnose session:

sdiz@sp2:/tmp$ git clone --verbose http://........
[...]
Getting index for pack fcedfaa7130866c884e208769661360563a3081f
Getting pack fcedfaa7130866c884e208769661360563a3081f
 which contains f197d4578a1b8ed195981d1e1ad4c390875c353a
error: index CRC mismatch for object
f197d4578a1b8ed195981d1e1ad4c390875c353a from
/tmp/egit-freenet/.git/objects/pack/pack-fcedfaa7130866c884e208769661360563a3081f.pack
at offset 12
error: index CRC mismatch for object
0b2cb180fef969e0da259765564f9bf8bcd8cf25 from
/tmp/egit-freenet/.git/objects/pack/pack-fcedfaa7130866c884e208769661360563a3081f.pack
at offset 183
error: index CRC mismatch for object
d88f5a430841925629c30199e666473d201bdf5a from
/tmp/egit-freenet/.git/objects/pack/pack-fcedfaa7130866c884e208769661360563a3081f.pack
at offset 379
error: index CRC mismatch for object
40d3204c679fc5d25281331b981d968016030930 from
/tmp/egit-freenet/.git/objects/pack/pack-fcedfaa7130866c884e208769661360563a3081f.pack
at offset 558
[...]
sdiz@sp2:/tmp$ git --version
git version 1.6.2


// Using the pack file directly seems okay, but fsck give the CRC error :

sdiz@sp2:/tmp/z$ git init
Initialized empty Git repository in /tmp/z/.git/
sdiz@sp2:/tmp/z$ cp ../pack-* .git/objects/pack/
sdiz@sp2:/tmp/z$ git checkout f197d4578a1b8ed195981d1e1ad4c390875c353a
warning: You appear to be on a branch yet to be born.
warning: Forcing checkout of f197d4578a1b8ed195981d1e1ad4c390875c353a.
Note: moving to "f197d4578a1b8ed195981d1e1ad4c390875c353a" which isn't
a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
  git checkout -b <new_branch_name>
HEAD is now at f197d45... Instruction for cloning with git+fproxy
sdiz@sp2:/tmp/z$ ls
0x7494252.asc  activelink.png  freenet-bunny.svg  index.html  jgit
jgit.jar  jgit_src.zip
sdiz@sp2:/tmp/z$
sdiz@sp2:/tmp/z$ git fsck f197d4578a1b8ed195981d1e1ad4c390875c353a
error: index CRC mismatch for object
f197d4578a1b8ed195981d1e1ad4c390875c353a from
.git/objects/pack/pack-fcedfaa7130866c884e208769661360563a3081f.pack
at offset 12
error: index CRC mismatch for object
0b2cb180fef969e0da259765564f9bf8bcd8cf25 from
.git/objects/pack/pack-fcedfaa7130866c884e208769661360563a3081f.pack
at offset 183
error: index CRC mismatch for object
d88f5a430841925629c30199e666473d201bdf5a from
.git/objects/pack/pack-fcedfaa7130866c884e208769661360563a3081f.pack
at offset 379
[...]

// unpack the objects manually seems to fix the issue
sdiz@sp2:/tmp/z$ rm -f .git/objects/*/*
sdiz@sp2:/tmp/z$ git unpack-objects --strict -r <
../pack-fcedfaa7130866c884e208769661360563a3081f.pack
Unpacking objects: 100% (26/26), done.
sdiz@sp2:/tmp/z$ git fsck --full f197d4578a1b8ed195981d1e1a
sdiz@sp2:/tmp/z$

// diff'ing the checkout with the original repository is also okay
sdiz@sp2:/tmp/z$ diff -Nau ~/build/egit/ .
Common subdirectories: /home/sdiz/build/egit/.git and ./.git
sdiz@sp2:/tmp/z$

// Fsck'ing in original repository is perfectly okay:

sdiz@sp2:~/build/egit$ git fsck --full f197d4
dangling commit 9900ac0df33e046c2f3f77ad8e084d535d3c023d
dangling commit 2e12ce6571923190124e86cc6b877ccb3ace9219
dangling commit f8150b71a352176f672270ffced6958682b215f3
dangling commit 101ae6bff9ca647c7c8297556314757162fbc2f2
[..]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-03-26  0:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24  2:53 [JGit] Mismatch CRC in packed objects from `jgit push` Daniel Cheng
2009-03-24 11:13 ` [JGIT Test Case] This (incomplete) test case demo the index wrong CRC bug Daniel Cheng (aka SDiZ)
2009-03-25  6:21 ` [PATCH JGIT 1/2] Calculate CRC32 on Pack Index v2 Daniel Cheng (aka SDiZ)
2009-03-25  6:21   ` [PATCH JGIT 2/2] Test case for pack index CRC Daniel Cheng (aka SDiZ)
2009-03-25 13:31   ` [PATCH JGIT 1/2] Calculate CRC32 on Pack Index v2 Marek Zawirski
2009-03-25 21:59     ` Shawn O. Pearce
2009-03-26  0:49     ` Daniel Cheng

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 NNTP newsgroup(s).