Knit inventory corrupt / wrong sha1

John Arbash Meinel john at arbash-meinel.com
Wed Mar 21 21:02:32 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mariano Mara wrote:
> Hi everyone.
> Yesterday I had a problem with my bzr and although I tried to fix it I'm
> still getting some errors messages that I would like to share with you
> and seek for advice.

I've been helping Mariano debug this problem, and it boils down to
hardware problems. Specifically when reading a file, the contents are
changing.

The simple proof I found was:


$ expected=`sha1sum ../../.bzr/repository/inventory.knit`
$ for i in `seq 100`; do \
  out=`sha1sum ../../.bzr/repository/inventory.knit` \
  if [ "$out" != "$expected" ]; then \
    echo "failed: $i $out"; \
  fi; done

failed: 7 73d46d49c7f0436c2de6baa7c423f5bd00b7abf1
../../.bzr/repository/inventory.knit
failed: 8 f626a68d51805cbd7868175e962d8353fd9d1598
../../.bzr/repository/inventory.knit
failed: 12 feb17e018830d7a363ad5e58fd4514ab165e8eaf
../../.bzr/repository/inventory.knit
failed: 28 675cc890b4daa6f37bbb71c6ea104976eddd3035
../../.bzr/repository/inventory.knit
failed: 42 d8b6aa0670567ec6d2f3a49741cc7214c8d9250b
../../.bzr/repository/inventory.knit

Basically, this shows me that there are random bit errors reading a
single file. I still haven't figured out why. If I try it on another
file, things seem to work. But if I copy then .knit file to another
filename, I still get the errors.

It could be because inventory.knit has 8-bit numbers, and the errors are
always in the high bit. (So plain text files never have that bit set,
and thus you don't get the error).

Regardless, if we can't guarantee that a plain read works, I don't think
bzr can really function.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGAZXIJdeBCYSNAAMRAv9KAKCxx4Ju3YWrHrQbash7AMnfeEM5AQCff047
7vymj2s4qW7vpxV2jW/yhqw=
=EPvp
-----END PGP SIGNATURE-----



More information about the bazaar mailing list