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

Re: [PATCH 0/2] infinite loop in "git ls-tree" for broken symlink

From
Jeff King <peff@peff.net>
Date
Oct 14, 2016, 13:42 UTC
Message-ID
<20161014134214.z3jzlx36y57cdqhu@sigill.intra.peff.net>
In-Reply-To
<1476451012-9925-1-git-send-email-pstodulk@redhat.com>
On Fri, Oct 14, 2016 at 03:16:50PM +0200, Petr Stodulka wrote:
Show 16 quoted lines
> I have realized that this wasn't fixed after all when refs.c
> was "rewritten". Issue is caused by broken symlink under refs/heads,
> which causes infinite loop for "git ls-tree" command. It was replied
> earlier [0] and Michael previously fixed that in better way probably,
> then my proposed patch 2/2, but it contains more changes and I have not
> enough time to study changes in refs* code, so I propose now just my
> little patch, which was previously modified by Michael.
> 
> If you prefer different solution, I am ok with this. It is really
> just quick proposal. Patch 1/2 contains test for this issue. If you
> will prefer different solution with different exit code, test should
> be corrected. Basic idea is, that timeout should'n expire with
> exit code 124.
> 
> [0] http://marc.info/?l=git&m=142712669103790&w=2
> [1] https://github.com/mhagger/git, branch "ref-broken-symlinks"
I think I fixed this semi-independently last week; see the thread at:
  http://public-inbox.org/git/20161006164723.ocg2nbgtulpjcksp@sigill.intra.peff.net/

I say semi-independently because I didn't actually know about your previous report, but saw it in the wild myself. But I did talk with Michael off-list, and he suggested the belt-and-suspenders retry counter in my second patch.

The fix is at e8c42cb in Junio's tree, and it's currently merged to 'next'.

-Peff
Previous: Petr StodulkaNext: Petr Stodulka
Message 5 of 6 in “infinite loop in "git ls-tree" for broken symlink”
  1. 0/2 infinite loop in "git ls-tree" for broken symlinkPetr Stodulka, Oct 14, 2016
  2. 1/2 Add test for ls-tree with broken symlink under refs/headsPetr Stodulka, Oct 14, 2016
  3. 2/2 resolve_ref_unsafe(): limit the number of "stat_ref" retriesPetr Stodulka, Oct 14, 2016
  4. Petr StodulkaOct 14, 2016
  5. Jeff KingOct 14, 2016
  6. Petr StodulkaOct 14, 2016

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.