Git index file corruption

Just wanted to add a new recipe to haikuports, so did a git clone on haikuports (depth 5, if that matters), do some work, everything fine.

Shutdown the Haiku VM, boot again a bit later and git status in that haikuports working directory now says “error: bad signature 0x61007000” and “fatal: index file corrupt”. This has happened twice in a row now (btw, the contents of the index file are really random bytes, i.e. some other memory area).

Hmm… I had also checked out haikuporter (the same time I checked out haikuports the first time), and the index file for haikuporter is still intact.

Anyone seen something similar? BTW, not seeing any instability with my set up (running Haiku in an QEMU VM on Linux)

Haiku haiku 1 hrev57458 Dec 11 2023 19:21:29 x86_64 x86_64 Haiku
git version 2.42.1

Did a few times git status where it complained about bad signature with different hex values, watched the file contents change with less (but the file modification timestamp didn’t change all the time), and suddenly I noticed that the correct signature showed up again and git status worked.

Something very weird must be going on here…

Another update: other than git status I have also been able to do a git fetch and git merge on that working tree. But several hours after that, I see that the index is corrupt again.

Does checkfs /boot report any errors?

No errors from checkfs

And after a reboot the index was fine again, so the on disk data seems to be fine, but probably the cache gets corrupted (but why I am only seeing it for this one file?).

Possibly related ticket: #12676 (After several hours of usage, suddenly, text files suffer data corruption (plain text is replaced with strange characters).) – Haiku

1 Like

Try creating a new virtual HD in your vm and start over, this sounds like a corrupt virtual HD if the corruption happens at the same spot of the disk every time.