Knit inventory corrupt / wrong sha1

John Arbash Meinel john at
Wed Mar 21 21:02:32 GMT 2007

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

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
failed: 8 f626a68d51805cbd7868175e962d8353fd9d1598
failed: 12 feb17e018830d7a363ad5e58fd4514ab165e8eaf
failed: 28 675cc890b4daa6f37bbb71c6ea104976eddd3035
failed: 42 d8b6aa0670567ec6d2f3a49741cc7214c8d9250b

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.


Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


More information about the bazaar mailing list