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

Re: [BUG] Segfault on git describe

From
DFDragos Foianu <dragos.foianu@gmail.com>
Date
Mar 19, 2014, 22:34 UTC
Message-ID
<loom.20140319T224201-156@post.gmane.org>
In-Reply-To
<532975FB.9030803@mozilla.com>
Sylvestre Ledru <sylvestre <at> mozilla.com> writes:
Show 25 quoted lines
> 
> Hello,
> 
> Trying to do some stats using the Firefox git repository
> (https://github.com/mozilla/gecko-dev), I found a bug
> on git describe. The following command will segfault:
> git describe --contains a9ff31aebd6dbda82a3c733a72eeeaa0b0525b96
> 
> Please note that the Firefox history is a pretty long and this commit
> date is 2001.
> 
> I experience this issue with the git version, and Debian packages
> (1.9.0-1 and 2.0~next.20140214-2)
> 
> As attachment, the backtrace. I removed about 87250 calls to the
> name_rev function. I guess that is a potential source of problem.
> 
> Full is available here:
> http://people.mozilla.org/~sledru/bt-git-on-ff.txt (21 MB)
> 
> I am available to test patches if needed.
> 
> Thanks,
> Sylvestre
> PS: I am not registered, please cc me.
Hello,

The name_rev function recursively calls itself which is why the backtrace is so big. Unfortunately, for repos with long histories it can lead to Stack Overflows. This is pretty much what happened in your case.

I tested it on my computer and I get the same results. I managed to get it working by doubling my default stacksize:

ulimit -S -s 16192

Considering your project is a very large one and merely allocating a few more resources fixes the problem, I'm not sure it warrants rewriting the function to use less stack. You will have to wait for one of the maintainers to give you a definitive answer.

All the best, Dragos

Previous: Sylvestre LedruNext: Jeff King
Message 3 of 5 in “[BUG] Segfault on git describe”
  1. Sylvestre LedruMar 19, 2014
  2. Sylvestre LedruMar 19, 2014
  3. Dragos FoianuMar 19, 2014
  4. Jeff KingMar 20, 2014
  5. Dragos FoianuMar 22, 2014

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.