Skip to content

bug: Windows stack overflow on startup (1MB default too small for Clap command graph) #855

Closed

Description

@pszymkowiak

Problem

On Windows, the default main-thread stack is 1MB. RTK's large Commands enum (70+ commands via Clap) can exceed this during startup, causing a stack overflow crash on rtk.exe --version or rtk.exe --help.

macOS/Linux default to 8MB stack so this doesn't affect them.

Fix

Add to build.rs:

#[cfg(windows)]
{
    println!("cargo:rustc-link-arg=/STACK:8388608"); // 8MB
}

Origin

Identified by @timeshift92 in PR #771 (Copilot PR, closed as duplicate — but this fix is valuable).

References

Activity

  1. added
    bug
    good first issue
    effort-small
    on Mar 26, 2026
  2. timeshift92 commented on Mar 27, 2026

    @timeshift92

    i added new pr where i'm fixed only this case #865

  3. pszymkowiak commented on Apr 3, 2026

    @pszymkowiak
    CollaboratorAuthor

    Fixed by PR #865 (merged March 28). The build.rs now sets /STACK:8388608 on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugeffort-smallgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions