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

Re: Infinite loop in cascade_filter_fn()

From
Carlos Martín Nieto <cmn@elego.de>
Date
Nov 25, 2011, 14:31 UTC
Message-ID
<20111125143131.GA10417@beez.lab.cmartin.tk>
In-Reply-To
<Pine.GSO.4.63.1111231801580.5099@shipon.roxen.com>
On Wed, Nov 23, 2011 at 06:40:47PM +0100, Henrik Grubbström wrote:
Show 5 quoted lines
> 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)).

It looks like it's a bug between cascade_filter_fn and the actual filter function lf_to_crlf_filter_fn that gets triggered when the output buffer is too small. In this particular case, *isize_p=378 and *osize_p=1 which causes cascade_filter_fn to feed the filter data which it can't process because it doesn't have anywhere to put it.

I think that the function assumes that the output buffer is always large enough, but there are many indirections, so it might be an off-by-one.

Show 21 quoted lines
> 
> How to reproduce:
> 
>   git clone git@github.com:pikelang/Pike.git
> 
>   git checkout -f 0e2080f838c6f0bc7d670ac7549676a353451dca^
> 
>   git checkout -f 0e2080f838c6f0bc7d670ac7549676a353451dca
> 
> The first two commands complete as expected, while the last hangs forever.
> Performing the same with git 1.7.6.4 works as expected.
> 
> The problematic file seems to be
> /src/modules/_Crypto/rijndael_ecb_vt.txt which has the attributes:
> text ident eol=crlf
> 
> Thanks,
> 
> --
> Henrik Grubbström					grubba@grubba.org
> Roxen Internet Software AB				grubba@roxen.com
Previous: Henrik GrubbströmNext: Carlos Martín Nieto
Message 2 of 16 in “Infinite loop in cascade_filter_fn()”
  1. Henrik GrubbströmNov 23, 2011
  2. Carlos Martín NietoNov 25, 2011
  3. Carlos Martín NietoNov 25, 2011
  4. Henrik GrubbströmNov 25, 2011
  5. Carlos Martín NietoNov 25, 2011
  6. Junio C HamanoNov 26, 2011
  7. Carlos Martín NietoNov 28, 2011
  8. Junio C HamanoNov 28, 2011
  9. Junio C HamanoDec 16, 2011
  10. lf_to_crlf_filter(): tell the caller we added "\n" when drainingJunio C Hamano, Dec 16, 2011
  11. Henrik GrubbströmDec 19, 2011
  12. Junio C HamanoDec 19, 2011
  13. Carlos Martín NietoDec 19, 2011
  14. Henrik GrubbströmNov 25, 2011
  15. Carlos Martín NietoNov 25, 2011
  16. Henrik GrubbströmNov 25, 2011

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.