Skip to content

fix: Windows stack overflow in ctx binary + broken CI test matrix#10

Merged
saldestechnology merged 1 commit into
mainfrom
fix/windows-stack-overflow
Jul 9, 2026
Merged

fix: Windows stack overflow in ctx binary + broken CI test matrix#10
saldestechnology merged 1 commit into
mainfrom
fix/windows-stack-overflow

Conversation

@saldestechnology

Copy link
Copy Markdown
Collaborator

Summary

Surfaced while merging the Quality Intelligence Suite PR stack: PR #4 (hotspots)'s CI failed on the test (stable) job with a stack overflow inside the compiled ctx binary (ctx index crashing all 5 hotspots_cli.rs integration tests). Investigation turned up two separate, pre-existing bugs, both fixed here rather than inside a feature PR:

  1. Stack overflow: Windows' default main-thread stack (~1 MiB, inherited from the PE header) is too small for this program's normal parsing/graph-walking call depth. main() now spawns its real work on a thread with an explicit 16 MiB stack; rayon's global pool (used by ctx index --parallel) gets the same treatment. Not reproducible locally on macOS (8 MiB default stack absorbs it), so this fixes the documented mechanism — final confirmation is the Windows CI leg on this PR.
  2. CI matrix bug: the test job's matrix had an unused rust: [stable] axis alongside include entries that all share the same keys (os, features). Per GitHub's matrix-merge rules, each include entry overwrote the previous one instead of creating a separate job, so only windows-latest --no-default-features has ever actually runubuntu-latest --all-features (which the workflow comment says exists specifically to cover the mcp/DuckDB feature) and macos-latest have never been exercised in this project's CI history. Removed the dead rust axis and added fail-fast: false so a failure on one OS doesn't hide results on the others.

Test plan

  • cargo build --all-features, cargo test --all-features, cargo fmt --check, cargo clippy --all-features -- -D warnings all clean locally.
  • This PR's own CI run is the first time ubuntu-latest --all-features and macos-latest will actually execute — watching for any latent failures those legs surface for the first time.

main() and rayon's global pool now run with an explicit 16 MiB stack
instead of the OS default (~1 MiB on Windows), which was insufficient
for this program's normal parsing/graph-walking call depth and caused
ctx index to crash with a stack overflow on Windows.

Also fixes the CI test job's matrix: the unused `rust: [stable]` axis
caused each `include` entry to overwrite the last (same os/features
keys, no other axis to key off of), so only windows-latest
--no-default-features ever actually ran; ubuntu-latest --all-features
and macos-latest had never been exercised in this project's CI history.
@saldestechnology
saldestechnology merged commit f78a5a9 into main Jul 9, 2026
5 checks passed
@saldestechnology
saldestechnology deleted the fix/windows-stack-overflow branch July 9, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant