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

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

From
Dale R. Worley <worley@alum.mit.edu>
Date
Dec 18, 2013, 21:08 UTC
Message-ID
<201312182108.rBIL8lAo015570@hobgoblin.ariadne.com>
In-Reply-To
<20131216191500.GD29324@sigill.intra.peff.net>
> From: Jeff King <peff@peff.net>
> One of the problems I ran into recently is that
> corrupt data can cause it to make a large allocation

One thing I notice is that in unpack_compressed_entry() in sha1_file.c, there is a mallocz of "size" bytes. It appears that "size" is the size of the object that is being unpacked. If so, this code cannot be correct, because it assumes that any file that is stored in the repository can be put into a buffer allocated in RAM.

Dale
Previous: Jeff KingNext: Jeff King
Message 5 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.