Repository navigation
Description
(Opus 5.5)
The deep_nesting test of citry_template_parser sometimes overflows its stack on the Windows runner, and the "Rust tests" workflow fails with:
thread '<unknown>' has overflowed its stack
error: test failed, to rerun pass `-p citry_template_parser --test deep_nesting`
A rerun passes. It has happened three times so far, each time on a change that touched no Rust code:
- 2026-11-15, main
b668c34fa - 2026-11-19, main
523173cd5(fix(citry-core): check functions passed to other functions in the sandbox; release citry-core 2.1.2 and citry 1.0.3 #797; only a README undercrates/changed) - 2026-11-21, ci: pin GitHub Actions by commit SHA and refresh msal-node and basic-ftp past advisories #831 (CI workflow changes only), run 44925322382
The macOS job in the same run is then cancelled by fail-fast, so one flake blocks the whole workflow.
What the test does
crates/citry_template_parser/tests/deep_nesting.rs parses, compiles, clones, compares, prints and drops templates up to the nesting limits (MAX_TAG_NESTING, MAX_LOGIC_NESTING) on threads with 256 KiB and 128 KiB stacks. It enters through with_enough_stack, the way the Python bindings do. The module comment says a new Windows thread has about 26 KiB less free stack than a Linux one, and the 128 KiB Windows case is expected to run entirely on a heap stack segment.
What to find out first
The log doesn't say which test case overflowed, because the cases run in parallel. Before changing limits:
- Reproduce on Windows with
cargo test -p citry_template_parser --test deep_nesting -- --test-threads=1, in a loop, to find the case and the stack size. - Decide between:
- a real gap: a path that grows the stack without passing a
with_enough_stackguard, or a guard whose red zone (RED_ZONE) is too small for a Windows debug build. In that case, fix the guard; the same guards protect the Python bindings. - test-only margin: the test's own frames, such as
with_stack_leftor the thread entry, use the last few KiB. In that case, give the test more headroom on Windows, and say why in a comment.
- a real gap: a path that grows the stack without passing a
The overflow is a hard abort, so the answer matters beyond CI: the inputs are templates (written by the template author), and the depth limits exist so that any accepted template parses on small thread stacks.
🤖 Generated with Claude Code
Activity