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

Re: [PATCH] graph: avoid infinite loop in graph_show_commit()

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 24, 2012, 23:36 UTC
Message-ID
<7vtxunvvr4.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8ApYKOU8v_-HkUC5uOb8gsheugKaXKMjbm0_-ygW_4jiQ@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 15 quoted lines
> On Sun, Sep 23, 2012 at 6:55 PM, Michal Kiedrowicz
> <michal.kiedrowicz@gmail.com> wrote:
>> Nguyễn Thái Ngọc Duy <pclouds <at> gmail.com> writes:
>>
>>>
>>> The loop can be triggered with "git diff-tree --graph commit" where
>>> the commit is a non-merge. It goes like this
>>
>>
>> Isn't this the same issue as in
>> http://article.gmane.org/gmane.comp.version-control.git/123979
>> ? (with slightly different fix)
>
> I don't know. I'm not familiar enough with graph.c to tell. Maybe Adam
> can have a look?

Has either of you tried the patch with the problematic case the other patch tries to solve? Michal's old patch does smell like it is going in the better direction in that it stops looping when we know we would only be showing the padding, which is a sign that we are done with showing the commit.

But I didn't look at it too closely. I'd prefer to see the assert(0) turned into die("BUG: internal error") at the end of graph_next_line() to catch these cases. Also I am not sure if assignment of the return value from graph_next_line() to shown_comit_line in the loop is correct (shouldn't it be OR'ing it in, so that "we have shown the information on this commit" is not lost when the function adds things after showing the commit???)

Previous: Nguyen Thai Ngoc DuyNext: Junio C Hamano
Message 4 of 5 in “graph: avoid infinite loop in graph_show_commit()”
  1. graph: avoid infinite loop in graph_show_commit()Nguyễn Thái Ngọc Duy, Sep 22, 2012
  2. Michal KiedrowiczSep 23, 2012
  3. Nguyen Thai Ngoc DuySep 23, 2012
  4. Junio C HamanoSep 24, 2012
  5. Junio C HamanoSep 25, 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.