How do I fix 'bus error' when trying to do git-commit or git-status
Asked Answered
M

4

11

I have a git repository on an OS X server that used to work fine. I was able to add files, commit them, and pull the content to my laptop.

Now, when I ssh into the server and do git commit or git status in the repository, all I see in the command line is bus error.

git log does still work properly and gives me the usual output.

I am guessing something is wrong with the repository, because in other repos on the same server both git commit and git status do still work.

How do I go about debugging / fixing this?

Update: I re-created the directory I last created before the problem occurred. That allowed me to do git status again!

Running git commit -a directly after that, however, gave the following error:

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.

I then manually deleted the index.lock file, and now the problem is solved..

I have no clue what has gone wrong. Any ideas..?

Monopolize answered 3/4, 2011 at 0:8 Comment(0)
D
6

Bus error indicates a memory problem; it could be as simple as a corrupted file on disk, a bug in the git program, or failing memory, memory controller, etc.

If you can run a memory testing tool on your computer overnight, that would help rule out failing memory and controller. (You might also spot them with odd SIGBUS or SIGSEGV during large compiles, or random crashes of other programs...)

Can you re-create the repository on the server from your laptop's clone, and see if it functions correctly? My guess is the repository is corrupted, and needs to be replaced with a good clone.

Desperate answered 3/4, 2011 at 0:13 Comment(3)
Thanks sarnold, have you seen the update to my issue? Do you think the fact that it just randomly seems to work again, indicates that the server indeed has memory issues?Monopolize
@Will0, without further info, I would just assume the stale lock file is a consequence of everything else here and nothing to worry about. (I know that sounds stupid, but I can't figure out how to say it smart.) If it keeps coming back, worry :) but it seems likely you just had a corrupted file on disk. (That might also be something worth worrying about, but unless you notice more corruption, I wouldn't worry about it too much either.)Desperate
Too bad, I just encountered the exact same problem :S. Deleting the directory allowed me to git status again, but committing wasn't allowed again due to the index.lock file. Deleted the index.lock and re-created the same dir, everything works again on the server.. for now I'm afraid?Monopolize
P
2

I noticed my Git client (Fork) used a different version of Git to the Apple System installed Git. By changing the version used in the GIT GUI client to align with the system version I was able to work around this issue.

Petit answered 29/10, 2023 at 23:46 Comment(0)
S
1

I encountered this issue due to a problem with the underlying filesystem on macOS Sierra (10.12.3). Essentially, for some reason my encrypted .dmg was corrupted - I think due to being extended with hdutils.

DiskUtility diagnosed the problem with the filesystem, but couldn't repair it.

The only solution I found was to recreate the image and re-clone the repo.

Sandpaper answered 16/2, 2017 at 15:21 Comment(0)
S
0

So what caused the issue for me was my icloud, it had to download the files from the cloud to my PC and what solved the issue for me was to delete the index and index.loc files in the hidden .git folder. After this then retry the git-add or git commit command

Cheers!!

Straightedge answered 6/6 at 16:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.