fix(windows): increase stack size to resolve runtime overflow#2621
fix(windows): increase stack size to resolve runtime overflow#2621
Conversation
Windows platforms have a default stack size (1-2MB) that is too small for the heavy JsonSchema derives in config/schema.rs (133 derives). This causes "thread 'main' has overflowed its stack" on startup. Changes: - Increase stack size to 8MB for x86_64-pc-windows-msvc - Increase stack size to 8MB for aarch64-pc-windows-msvc - Remove unused ErrorKind import in src/update.rs Fixes: cargo run --bin zeroclaw stack overflow on Windows
PR intake checks found warnings (non-blocking)Fast safe checks found advisory issues. CI lint/test/build gates still enforce merge quality.
Action items:
Detected Linear keys: none Run logs: https://github.com/zeroclaw-labs/zeroclaw/actions/runs/22615081314 Detected blocking line issues (sample):
Detected advisory line issues (sample):
|
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Cargo Configuration .cargo/config.toml |
Added Windows MSVC target configurations (x86_64-pc-windows-msvc and aarch64-pc-windows-msvc) with rustflags to increase stack size to 8388608 bytes. |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Suggested labels
bug, size: XS, risk: medium, config: core
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | The PR description is missing most required sections from the repository template (Label Snapshot, Change Metadata, Linked Issue, Validation Evidence, Security Impact, etc.). | Complete the PR description by filling in all required template sections including labels, change type, linked issues, validation evidence, security/privacy checks, and rollback plan. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly and specifically summarizes the main change: increasing Windows stack size to fix a runtime overflow issue. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
fix/windows-stack-size
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.cargo/config.toml (1)
28-33: Consider adding a Windows CI smoke test for regression protection.A minimal Windows job running
cargo run --bin zeroclaw -- --versionwould help ensure this stack-overflow fix stays covered.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cargo/config.toml around lines 28 - 33, Add a minimal Windows CI smoke test to protect the increased Windows stack-size change under the [target.x86_64-pc-windows-msvc] and [target.aarch64-pc-windows-msvc] rustflags: create a CI job that runs on a Windows runner and executes cargo run --bin zeroclaw -- --version (or cargo build && cargo run --bin zeroclaw -- --version) to verify the binary starts successfully; ensure the job is included in the matrix or workflow that runs on PRs so future regressions to .cargo/config.toml (the rustflags /STACK change) get caught automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.cargo/config.toml:
- Around line 28-33: Add a minimal Windows CI smoke test to protect the
increased Windows stack-size change under the [target.x86_64-pc-windows-msvc]
and [target.aarch64-pc-windows-msvc] rustflags: create a CI job that runs on a
Windows runner and executes cargo run --bin zeroclaw -- --version (or cargo
build && cargo run --bin zeroclaw -- --version) to verify the binary starts
successfully; ensure the job is included in the matrix or workflow that runs on
PRs so future regressions to .cargo/config.toml (the rustflags /STACK change)
get caught automatically.
Problem
Running
cargo run --bin zeroclawon Windows fails with:Root Cause
Windows platforms have a default stack size (1-2MB) that is insufficient for:
JsonSchemaderives insrc/config/schema.rsschemarslibrary at compile timeSolution
Increase stack size to 8MB for Windows targets in
.cargo/config.toml:Changes
ErrorKindimport insrc/update.rsTesting
Fixes: Windows runtime stack overflow on program startup
Supersedes #2591 by @killf
This PR carries forward the same Windows stack size fix from the original PR.
Summary by CodeRabbit