All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [BUG] serious inflate inconsistency on master
Date: Tue, 03 Jul 2012 23:31:43 -0700	[thread overview]
Message-ID: <7vy5n0rq9c.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CACsJy8AFs6PV8XCAUar9KadE8g-WSaZofKQAGPB6VjbhVpSRig@mail.gmail.com> (Nguyen Thai Ngoc Duy's message of "Wed, 4 Jul 2012 12:35:34 +0700")

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.

  reply	other threads:[~2012-07-04  6:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03 22:19 [BUG] serious inflate inconsistency on master Jeff King
2012-07-03 22:40 ` Junio C Hamano
2012-07-04  5:35   ` Nguyen Thai Ngoc Duy
2012-07-04  6:31     ` Junio C Hamano [this message]
2012-07-04  7:01       ` Nguyen Thai Ngoc Duy
2012-07-04  7:24         ` Jeff King
2012-07-04  7:12       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vy5n0rq9c.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.