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

Re: [PATCH] git tag --contains : avoid stack overflow

From
Jeff King <peff@peff.net>
Date
Apr 17, 2014, 21:58 UTC
Message-ID
<20140417215817.GA822@sigill.intra.peff.net>
In-Reply-To
<alpine.DEB.1.00.1404172347440.14982@s15462909.onlinehome-server.info>
On Thu, Apr 17, 2014 at 11:52:56PM +0200, Johannes Schindelin wrote:
Show 9 quoted lines
> > I tried running the test on my Linux box, but it doesn't fail with the
> > existing recursive code.
> 
> I cannot recall how I came to choose 64, but I *think* I only tested on
> Windows, and I *think* I reduced the number of tags in order to make
> things faster (Windows is *unbearably* slow with spawn-happy programs such
> as Git's tests -- literally every single line in a shell script tests the
> patience of this developer, running the complete test suite with 15
> parallel threads takes several hours, no kidding).

Yeah, I figured speed had something to do with it. However, since you are using a bash loop to generate the input (and it should all be done as builtins in bash, I think), and fast-import to create the objects, I don't think bumping it will actually increase your process count.

Show 9 quoted lines
> > The results are strangely non-deterministic, but with -O0, we generally
> > die reliably below about 60. With -O2, though, it's more like 43. We
> > can't go _too_ low here, though, as lots of things start breaking around
> > 32.
> 
> How about using 40, then? I am more interested in reducing the runtime
> than reducing the number of false negatives. The problem will be exercised
> enough on Windows, but not if the test suite becomes even slower than it
> already is.

I'm OK with doing that. My biggest concern is that it will cause false positives on systems that are hungrier for stack space, but we can address that if it happens.

-Peff
Previous: Johannes SchindelinNext: Stepan Kasal
Message 6 of 24 in “git tag --contains : avoid stack overflow”
  1. git tag --contains : avoid stack overflowStepan Kasal, Apr 16, 2014
  2. Jeff KingApr 16, 2014
  3. Johannes SchindelinApr 17, 2014
  4. Jeff KingApr 17, 2014
  5. Johannes SchindelinApr 17, 2014
  6. Jeff KingApr 17, 2014
  7. git tag --contains : avoid stack overflowStepan Kasal, Apr 23, 2014
  8. Johannes SchindelinApr 23, 2014
  9. Stepan KasalApr 23, 2014
  10. Junio C HamanoApr 23, 2014
  11. Jeff KingApr 23, 2014
  12. Junio C HamanoApr 23, 2014
  13. Jeff KingApr 23, 2014
  14. Junio C HamanoApr 23, 2014
  15. Stepan KasalApr 24, 2014
  16. Stepan KasalApr 24, 2014
  17. Jeff KingApr 25, 2014
  18. Andreas SchwabSep 20, 2014
  19. Jeff KingSep 23, 2014
  20. Andreas SchwabSep 23, 2014
  21. Junio C HamanoSep 23, 2014
  22. Stepan KasalApr 23, 2014
  23. Jeff KingApr 23, 2014
  24. Johannes SchindelinApr 23, 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.