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

Re: Segfault during fsck and spreading brokenness

From
Jeff King <peff@peff.net>
Date
Sep 25, 2020, 17:47 UTC
Message-ID
<20200925174718.GA70005@coredump.intra.peff.net>
In-Reply-To
<2aa62ff7-0780-8e20-e87d-387152524971@artfulrobot.uk>
On Fri, Sep 25, 2020 at 04:48:39PM +0100, Rich wrote:
Show 5 quoted lines
> I was encouraged by a couple of people on stackoverflow to post to this
> list. Apols in advance if it's not the right place.
>
> I encountered a Segfault during fsck on a damaged bare repo (probably due to
> a powercut. Possibly during an operation, although not sure):
Thanks for the report. This is definitely the right place.
Show 12 quoted lines
> git --version
> git version 2.11.0
> 
> git fsck --full -v
> Checking HEAD link
> Checking object directory
> Checking tree 11bbc847cf1b4422b3e37830a9eac2e7af6559de
> Checking tree 11be4abeb20314de6145dfc0e6180807a74c03dc
> --->8 snip 8<---------------------------------------------------------------
> Checking tree 14a4423e86f06c7ad75bf391d138e0cf7790508f
> Checking tree 147aeaec72b2f29bf1813494c942fbce497be679
> zsh: segmentation fault  git fsck --full -v

It's tough to say from this where the problem might be. If you still have the broken repo and can reproduce, two things that might help:

  - trying with a more recent version of Git; we've fixed quite a few
    segfaults around corrupted data in the past few years
  - getting a backtrace; if you can build Git from source, the simplest
    thing is just running "gdb --args /path/to/your/git fsck --full -v",
    waiting for it to crash, and then running "bt" in the debugger
Show 5 quoted lines
> I learnt about the damage while trying to `git push`  from my dev working
> tree. I think I did a `git pull` when the `git push` failed. The result of
> this was that my *local* repo was also damaged: there was an empty file
> created that would stop git operations and on deleting that I got a page
> full of errors.

That's concerning; push/pull generally try hard not to let corruption spread. What transport do you use between the two servers? The usual git-over-ssh and git-over-http protocols should be pretty resilient, but I would not be surprised if the old dumb-http protocol, which just downloads remote files wholesale, would be confused by a zero-length loose object file or similar.

-Peff
Previous: RichNext: Rich
Message 2 of 3 in “Segfault during fsck and spreading brokenness”
  1. RichSep 25, 2020
  2. Jeff KingSep 25, 2020
  3. RichSep 28, 2020

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.