在尝试执行git-commit或git-status时如何修复"总线错误"

Wil*_*ins 7 git macos bus-error git-commit git-status

我在OS X服务器上有一个git存储库,以前工作正常.我能够添加文件,提交它们,并将内容提取到我的笔记本电脑.

现在,当我进入服务器并执行git commitgit status在存储库中时,我在命令行中看到的只是bus error.

git log 仍然可以正常工作,并给我通常的输出.

我猜的东西是错误与资源库,因为在同一服务器上其他回购git commitgit status做仍然可以工作.

我该如何调试/修复此问题?

更新:我在问题发生之前重新创建了我上次创建的目录.这让我再做git status一次!

git commit -a但是,在此之后直接运行会出现以下错误:

fatal: Unable to create '/path/to/repo/.git/index.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
Run Code Online (Sandbox Code Playgroud)

然后我手动删除了index.lock文件,现在问题解决了..

我不知道出了什么问题.有任何想法吗..?

sar*_*old 5

Bus error表示内存问题; 它可能像磁盘上损坏的文件,git程序中的错误,内存,内存控制器等故障一样简单.

如果你可以在一夜之间在计算机上运行内存测试工具,这将有助于排除内存和控制器故障.(您可能还会发现奇怪的SIGBUSSIGSEGV大型编译时,或其他程序的随机崩溃...)

您可以从笔记本电脑的克隆中重新创建服务器上的存储库,看看它是否正常运行?我的猜测是存储库已损坏,需要用一个好的克隆替换.