Git reports fsck "sha1 mismatch"

We have the following problem when running the git fsck --full --strict :

 error: sha1 mismatch ced885d12a0677f2db9025e1e684c72e67283fcd error: ced885d12a0677f2db9025e1e684c72e67283fcd: object corrupt or missing error: sha1 mismatch cf5a1546bd2de5611eaf6136fb5ca02b4e358bec error: cf5a1546bd2de5611eaf6136fb5ca02b4e358bec: object corrupt or missing error: sha1 mismatch cf5d9d5723014921370de479c54a73230c86a981 error: cf5d9d5723014921370de479c54a73230c86a981: object corrupt or missing error: sha1 mismatch cf675ce5bc5eeb5937441c6a02976cf2fa40076b error: cf675ce5bc5eeb5937441c6a02976cf2fa40076b: object corrupt or missing error: sha1 mismatch cf7c5156cf127eb7141505946df51b2b57925a50 error: cf7c5156cf127eb7141505946df51b2b57925a50: object corrupt or missing dangling commit 3468455f0d9d055bbe957744aa10e670469d3912 dangling commit daeec54632203157a70bae93b9d7c3290820c2f9 (more dangling commit messages) 

(Note: I really don't like messages about dangling messages. I focus on the sha1 mismatch issue.)

My interpretation of this post is that git -fsck recompiles sha1 from the payload, but found that sha1 is different from the one used to indicate the object. Objects did not disappear from the repository (I checked w / git cat-file).

It is strange that if I run the command again, I still have sha1 messages, but for different objects:

 error: sha1 mismatch 1452752024456a509540591c4879b3e3534f457e error: 1452752024456a509540591c4879b3e3534f457e: object corrupt or missing error: sha1 mismatch 16e08310d7182e97092d2783c911dbcf66538238 error: 16e08310d7182e97092d2783c911dbcf66538238: object corrupt or missing dangling commit 3468455f0d9d055bbe957744aa10e670469d3912 

Note: the repository has not changed between the two launches.

We are running Linux, and the current version of git is:

 $git --version git version 1.7.2.2.170.g5c7f2 

Errors were in the previous version (1.6.5.rc2.18.g6d8b). Those git were built from sources using gcc 3.4.4.

HOWEVER, when I copy the repository to another host, git fsck does not report anything. The git version is 1.7.2.1 (provided by Fedora).

I made the following comments:

  • Objects with invalid sha1 are often in the same range (in the first example, sha1s start with ce or cf), and errors are triggered for a short period during fsck startup. I believe that git-fsck performs an ordered scan (or maybe objects are sorted inside the package).
  • These objects are relatively large drops (> 900k)
  • We performed a 15-minute full memtest pass for a possible hardware failure. We did not find any problems. There is no other weird behavior on this server that also performs many other git tasks.
  • git gc doesn't complain

Hypotheses so far:

  • This problem is caused by incorrect git build (version library? Compiler?)
  • Our memtest could not find the real memory problem.
  • There is a subtle error in the calculations of git-fsck sha1 that occurs randomly (or, more precisely, during certain short time windows) for large blocks.

How can we solve this?

+4
source share
1 answer

Perhaps this was some kind of hardware problem.

+2
source

All Articles