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

Re: [PATCH 6/6] max_tree_depth: lower it for clangarm64 on Windows

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 22, 2025, 07:43 UTC
Message-ID
<aAdImbydzMUkCFqB@pks.im>
In-Reply-To
<6ebc3ef57fd0455fc70c4a8531c7ed094d9cdaff.1745239150.git.gitgitgadget@gmail.com>
On Mon, Apr 21, 2025 at 12:39:10PM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 10 quoted lines
> diff --git a/environment.c b/environment.c
> index 9e4c7781be0..cc853950bb2 100644
> --- a/environment.c
> +++ b/environment.c
> @@ -82,9 +82,21 @@ int max_allowed_tree_depth =
>  	 * the stack overflow can occur.
>  	 */
>  	512;
> +#else
> +#if defined(GIT_WINDOWS_NATIVE) && defined(__clang__) && defined(__aarch64__)

Tiny nit, only because it puzzled me for a second: this should probably be `#elif`.

Show 13 quoted lines
> +	/*
> +	 * Similar to Visual C, it seems that on Windows/ARM64 the clang-based
> +	 * builds have a smaller stack space available. When running out of
> +	 * that stack space, a `STATUS_STACK_OVERFLOW` is produced. When the
> +	 * Git command was run from an MSYS2 Bash, this unfortunately results
> +	 * in an exit code 127. Let's prevent that by lowering the maximal
> +	 * tree depth; This value seems to be low enough.
> +	 */
> +	1280;
>  #else
>  	2048;
>  #endif
> +#endif

Hm. This whole construct feels rather awful, if you ask me. Instead of papering over the issue it would be nice if we eventually fixed the root cause, which is that we use recursion on a data structure that has an unbounded depth in theory.

Anyway, that is clearly outside of the scope of this patch series, so the bandaid is good enough for now.

Patrick
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin
Message 9 of 20 in “Support Windows/ARM64”
  1. 0/6 Support Windows/ARM64Johannes Schindelin via GitGitGadget, Apr 21, 2025
  2. 1/6 bswap.h: add support for built-in bswap functionsDennis Ameling via GitGitGadget, Apr 21, 2025
  3. 2/6 config.mak.uname: add support for clangarm64Dennis Ameling via GitGitGadget, Apr 21, 2025
  4. 3/6 mingw: do not use nedmalloc on Windows/ARM64Johannes Schindelin via GitGitGadget, Apr 21, 2025
  5. Patrick SteinhardtApr 22, 2025
  6. Dropping nedmalloc support? was Re: [PATCH 3/6] mingw: do not use nedmalloc on Windows/ARM64Johannes Schindelin, Apr 22, 2025
  7. 4/6 msvc: do handle builds on Windows/ARM64Johannes Schindelin via GitGitGadget, Apr 21, 2025
  8. 6/6 max_tree_depth: lower it for clangarm64 on WindowsJohannes Schindelin via GitGitGadget, Apr 21, 2025
  9. Patrick SteinhardtApr 22, 2025
  10. Johannes SchindelinApr 22, 2025
  11. 5/6 mingw(arm64): do move the `/etc/git*` locationJohannes Schindelin via GitGitGadget, Apr 21, 2025
  12. Junio C HamanoApr 21, 2025
  13. 0/6 Support Windows/ARM64Johannes Schindelin via GitGitGadget, Apr 23, 2025
  14. 1/6 bswap.h: add support for built-in bswap functionsDennis Ameling via GitGitGadget, Apr 23, 2025
  15. 2/6 config.mak.uname: add support for clangarm64Dennis Ameling via GitGitGadget, Apr 23, 2025
  16. 3/6 mingw: do not use nedmalloc on Windows/ARM64Johannes Schindelin via GitGitGadget, Apr 23, 2025
  17. Junio C HamanoApr 23, 2025
  18. 4/6 msvc: do handle builds on Windows/ARM64Johannes Schindelin via GitGitGadget, Apr 23, 2025
  19. 5/6 mingw(arm64): do move the `/etc/git*` locationJohannes Schindelin via GitGitGadget, Apr 23, 2025
  20. 6/6 max_tree_depth: lower it for clangarm64 on WindowsJohannes Schindelin via GitGitGadget, Apr 23, 2025

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.