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

Re: [BUG] serious inflate inconsistency on master

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 4, 2012, 06:31 UTC
Message-ID
<7vy5n0rq9c.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8AFs6PV8XCAUar9KadE8g-WSaZofKQAGPB6VjbhVpSRig@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> By the way I searched the commit that introduces that check with "git
> log --follow -p builtin/index-pack.c" but I could not find it. What
> did I do wrong?

Your commit 8a2e163cc shows changes to the file at ll.535-540; these come from 776ea370 builtin-index-pack.c ll.383-388.

  $ git show 776ea370:builtin-index-pack.c

The get_data_from_pack() function in that commit gives sufficient buffer to output side (avail_out starts out as obj->size), and feeds the data from the packfile in chunks. With the arrangement this commit makes to call git_inflate(), it should never get stuck because it ran out of output buffer. In each iteration of the loop, when the function returns, status should read Z_OK and the function should have consumed all input.

But the version that uses consume() function does not give sufficient output buffer to ensure that the input will always be inflated fully (avoiding to use large output buffer is the whole point of your patch after all), so with your patch, that no longer holds true.

Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 4 of 7 in “[BUG] serious inflate inconsistency on master”
  1. Jeff KingJul 3, 2012
  2. Junio C HamanoJul 3, 2012
  3. Nguyen Thai Ngoc DuyJul 4, 2012
  4. Junio C HamanoJul 4, 2012
  5. Nguyen Thai Ngoc DuyJul 4, 2012
  6. Jeff KingJul 4, 2012
  7. Jeff KingJul 4, 2012

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.