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

Re: "git fsck" fails on malloc of 80 G

From
Jeff King <peff@peff.net>
Date
Dec 16, 2013, 19:15 UTC
Message-ID
<20131216191500.GD29324@sigill.intra.peff.net>
In-Reply-To
<201312161605.rBGG5Wm5027739@hobgoblin.ariadne.com>
On Mon, Dec 16, 2013 at 11:05:32AM -0500, Dale R. Worley wrote:
> # git fsck
> Checking object directories: 100% (256/256), done.
> fatal: Out of memory, malloc failed (tried to allocate 80530636801 bytes)
> #

Can you give you give us a backtrace from the die() call? It would help to know what it was trying to allocate 80G for.

> I don't know if this is due to an outright bug or not.  But it seems
> to me that "git fsck" should not need to allocate any more memory than
> the size (1 GiB) of a single pack file.  And given its purpose, "git
> fsck" should be one of the *most* robust Git tools!

Agreed. Fsck tends to be more robust, but there are still many code paths that can die(). One of the problems I ran into recently is that corrupt data can cause it to make a large allocation; we notice the bogus data as soon as we try to start filling the buffer, but sometimes the bogus allocation is large enough to kill the process.

That was fixed by b039718, which is in master but not yet any released version. You might see whether that helps.

-Peff
Previous: Dale R. WorleyNext: Dale R. Worley
Message 2 of 6 in “"git fsck" fails on malloc of 80 G”
  1. Dale R. WorleyDec 16, 2013
  2. Jeff KingDec 16, 2013
  3. Dale R. WorleyDec 18, 2013
  4. Jeff KingDec 18, 2013
  5. Dale R. WorleyDec 18, 2013
  6. Jeff KingDec 18, 2013

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.