Nikhil Desai
Nikhil Desai

Reputation: 11

Cause of non-deterministic `git fsck` errors on MacOS 11.2.3, even after deleting and re-cloning?

I have several git and git-annex repositories on my personal laptop, which runs MacOS 11.2.3 with git version 2.24.3 (Apple Git-128) and git-annex 8.20210310.

After upgrading my laptop to 11.2.x (Big Sur), I began noticing a much higher level of errors when running git fsck over repositories on disk, even when there was no clear reason why such errors should be occurring. To fix this, I have deleted and re-cloned many repositories from remotes in an attempt to squash these errors.

Recently, I observed git fsck errors in a git-annex repo that I had deleted and re-cloned just prior (though I had also merged in commits from another remote). I also observed inexplicable non-deterministic behavior from git fsck in this repo, in which re-running the command multiple times would yield different results, as below:

nikhil@laptop myrepo% git fsck
error: unable to mmap .git/objects/cb/e4d5322a6295944dd546471332f97b3592bbd2: Interrupted system call
error: cbe4d5322a6295944dd546471332f97b3592bbd2: object corrupt or missing: .git/objects/cb/e4d5322a6295944dd546471332f97b3592bbd2
Checking object directories: 100% (256/256), done.
Checking objects: 100% (277327/277327), done.
Checking connectivity: 292264, done.
dangling tree f258d3cd1745f93f8571c5c3e3b4c6b5ba54767b
missing tree cbe4d5322a6295944dd546471332f97b3592bbd2
nikhil@laptop myrepo% git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (277327/277327), done.
Checking connectivity: 292267, done.
nikhil@laptop myrepo% git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (277327/277327), done.
fatal: failed to read object 2d218c33679a8d84e43eaa1189eb22dc6e35bf07: Interrupted system call
nikhil@laptop myrepo% git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (277327/277327), done.
fatal: failed to read object deec5afa6919ad1ae0433335bab9bd87ef95f5d0: Interrupted system call

Here, git fsck completes once with problems detected, completes once with no problems detected, and then fails twice due to read errors on two different objects.

This would suggest that the root cause is potentially some filesystem or disk corruption, but one signal against this is the fact that errors began popping up after the upgrade to Big Sur, and for most repos were squashed by deleting and re-cloning. I've also previously run the MacOS Disk Utility after experiencing these errors to check for disk corruption, and no problems were detected - however this was a while ago and I'm re-running to confirm.

Have others experienced these problems - either generically, higher rates of git fsck errors after upgrading to MacOS 11.2.x, or specifically non-determinism in git fsck? What could be the root cause of these errors?

Edit: torek's comment below led to me discovering this SuperUser question, which suggested errors like this might be related to antivirus. I am currently running BitDefender but am experiencing these issues when its "Shield" functionality is turned off. I also had installed Avast and Avira on my laptop at points in the past, but both have been uninstalled on my laptop for several months.

Upvotes: 0

Views: 80

Answers (1)

Nikhil Desai
Nikhil Desai

Reputation: 11

Googling strongly suggests this is related to running antivirus software on MacOS Big Sur. This SuperUser question indicates this has been experienced with Avast and other threads suggest BitDefender and Avira cause similar problems.

After I uninstalled antivirus software as suggested by @bk2204, the problem did not re-occur.

Upvotes: 1

Related Questions