git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Carlos Martín Nieto" <cmn@elego.de>
To: "Henrik Grubbström" <grubba@roxen.com>
Cc: Git Mailing list <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: Infinite loop in cascade_filter_fn()
Date: Fri, 25 Nov 2011 16:53:01 +0100	[thread overview]
Message-ID: <20111125155301.GC10417@beez.lab.cmartin.tk> (raw)
In-Reply-To: <Pine.GSO.4.63.1111251629500.22588@shipon.roxen.com>

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

On Fri, Nov 25, 2011 at 04:43:41PM +0100, Henrik Grubbström wrote:
> On Wed, 23 Nov 2011, Henrik Grubbström wrote:
> 
> >Hi.
> >
> >My git repository walker just got bitten by what seems to be a
> >reasonably new bug in convert.c:cascade_filter_fn() (git 1.7.8.rc3
> >(gentoo)).
> 
> After some tracing, the problem is triggered by the variable "remaining"
> being set to 1 in the beginning of the cascade_filter_fn() loop,
> which causes filter "two" to be called with an output buffer size of
> 1.
> Filter "two" in this case is lf_to_crlf_filter_fn(), and the next
> input character is a "\n". lf_to_crlf_filter_fn() wants to convert
> this to "\r\n", but that doesn't fit into the buffer, so it breaks
> out and returns zero. Upon seing the zero cascade_filter_fn() thinks
> all is well, even though nothing has happened, and loops.
> 
> The bug is probably that lf_to_crlf_filter_fn() should return
> non-zero in this case (ie o and/or i being zero).

non-zero? That would cause the filter to abort, which definitely not
what we want. Have you seen my other e-mails regarding this? I'm
trying to figure out which is the best way to go about this. The
solution is to keep track of the fact that we're missing a LF in the
output buffer.

   cmn

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2011-11-25 15:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 17:40 Infinite loop in cascade_filter_fn() Henrik Grubbström
2011-11-25 14:31 ` Carlos Martín Nieto
2011-11-25 15:38 ` Carlos Martín Nieto
2011-11-25 16:14   ` Henrik Grubbström
2011-11-25 17:02     ` Carlos Martín Nieto
2011-11-26 22:48       ` Junio C Hamano
2011-11-28 10:48         ` Carlos Martín Nieto
2011-11-28 19:18           ` Junio C Hamano
2011-12-16 22:01           ` Junio C Hamano
2011-12-16 22:43             ` [PATCH] lf_to_crlf_filter(): tell the caller we added "\n" when draining Junio C Hamano
2011-12-19 10:19               ` Henrik Grubbström
2011-12-19 20:23                 ` Junio C Hamano
2011-12-19 16:42             ` Infinite loop in cascade_filter_fn() Carlos Martín Nieto
2011-11-25 15:43 ` Henrik Grubbström
2011-11-25 15:53   ` Carlos Martín Nieto [this message]
2011-11-25 15:59     ` Henrik Grubbström

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20111125155301.GC10417@beez.lab.cmartin.tk \
    --to=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=grubba@roxen.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).