git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: My git repo is broken, how to fix it ?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 22, 2007, 16:17 UTC
Message-ID
<Pine.LNX.4.64.0703220858400.6730@woody.linux-foundation.org>
In-Reply-To
<200703211024.04740.litvinov2004@gmail.com>
[ Git list cc'd again - I modified your branch names and commit header 
  line just in case you care about those ]
On Wed, 21 Mar 2007, Alexander Litvinov wrote:
Show 6 quoted lines
> 
> I have a good news : I got the breakage again. And I can reproduce it :-)
> 
> This is a version of git with three your patches.
> 
> Here is the steps to broke my repo:

So does it break every time if you do this particular sequence with the particular state that it has? If so, wonderful, since it should mean that you can also recreate the file that got corrupted as a blob.

Show 10 quoted lines
> $ git prune
> $ git fsck --full
> dangling commit 50267ccaa820c456bd361db808f99d81714cbce8
> $ git rebase fix-autoxyzzy                                    
> First, rewinding head to replay your work on top of it...
> HEAD is now at 42af3b2... Replace ...
> Applying 'Show ...'
> 
> Wrote tree 851c5d8d2213c60efc1bd081b0012bfcc9e558b5
> Committed: e7117e5637e881368ff04e94a27dca2abdb12d38
And then..
Show 7 quoted lines
> [lan@ac-7923bb4c6c14 navitel (debug-autoxyzzy)]$ git fsck --full
> error: corrupt loose object 'c01848491b53c3dcfd738149193a14d3c9abe107'
> error: c01848491b53c3dcfd738149193a14d3c9abe107: object corrupt or missing
> missing blob c01848491b53c3dcfd738149193a14d3c9abe107
> dangling commit 50267ccaa820c456bd361db808f99d81714cbce8
> 
> What can I do to debug this ?

Every time there's a corrupt object, if you can send it to me, that would be good. If you can tell the source for the corrupt object and can send that to me too, that's always even better, but even in the absense of that, the more corrupt objects I have, the better the chances that I see some pattern. And if it's always the same object that gets corrupted the same way when you start from a particular starting point, that would also be very interesting to know.

Considering that the "don't use hardlinks on cygwin" thing didn't matter for you (and really, I would have only expected it to matter if you used ^C to kill a process in the middle or something), you migth also be better off just trackng the standard git, since it now has Nicos extra consistency checks over and beyond those I send you.

It's also possible that the real bug is that we have some memory scribble internally in git, and that it shows up for you just because Cygwin and/or WinXp has different allocation patterns than other platforms. Do you know if there are any "debugging malloc" libraries for Cygwin? Something like ElectricFence/dmalloc under Linux, or running with valgrind.

Since it happens after a single rebase, if it's a git bug (as opposed to,for example, a zlib problem or simply a problem in your combination of vmware/winxp/cygwin), it would be the recursive merge that screws up. It *is* one of the more complex operations (especially if it also ends up doing file-level merging, which I assume it does), so some memory allocation problem there is not out of the question, although it's strange that you see it but the (many more) users on UNIX never seem to - it's not like rebase is an uncommon operation!

		Linus
Previous: Nicolas PitreNext: Linus Torvalds
Message 14 of 28 in “My git repo is broken, how to fix it ?”
  1. Alexander LitvinovFeb 28, 2007
  2. Linus TorvaldsFeb 28, 2007
  3. Alexander LitvinovFeb 28, 2007
  4. Linus TorvaldsFeb 28, 2007
  5. Alex RiesenFeb 28, 2007
  6. Alexander LitvinovMar 19, 2007
  7. Linus TorvaldsMar 19, 2007
  8. Linus TorvaldsMar 20, 2007
  9. Alexander LitvinovMar 20, 2007
  10. Junio C HamanoMar 20, 2007
  11. Nicolas PitreMar 20, 2007
  12. Linus TorvaldsMar 22, 2007
  13. Nicolas PitreMar 22, 2007
  14. Linus TorvaldsMar 22, 2007
  15. Linus TorvaldsMar 22, 2007
  16. Linus TorvaldsMar 22, 2007
  17. Nicolas PitreMar 22, 2007
  18. Linus TorvaldsMar 22, 2007
  19. Nicolas PitreMar 22, 2007
  20. Jeff KingMar 22, 2007
  21. Linus TorvaldsMar 23, 2007
  22. Bill LearMar 23, 2007
  23. Jeff KingMar 23, 2007
  24. git-apply: Do not free the wrong buffer when we convert the data for writeoutJunio C Hamano, Mar 22, 2007
  25. Linus TorvaldsMar 22, 2007
  26. Alexander LitvinovMar 23, 2007
  27. Alexander LitvinovMar 23, 2007
  28. Johannes SixtMar 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.