From 372d23b7e49cd7a5494075d92030ab12df52807c Mon Sep 17 00:00:00 2001 From: guiqingle520 <44358985+guiqingle520@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:30:05 +0800 Subject: [PATCH] fix(windows): link the app with an 8 MB main-thread stack (#5830) Windows gives the main thread a 1 MB stack by default, where macOS and Linux give 8 MB. Unoptimized debug frames overflowed it (STATUS_STACK_OVERFLOW, 0xc00000fd) after opening a Java project and clicking Settings. The MSVC build now links with /STACK:8388608, so the main thread gets the same 8 MB as elsewhere; other threads are unchanged. Closes #5825 Co-authored-by: guiqingle520 <44358985+guiqingle520@users.noreply.github.com> --- src-tauri/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src-tauri/build.rs b/src-tauri/build.rs index e28714deee..7aae5bb04f 100644 --- a/src-tauri/build.rs +++ b/src-tauri/build.rs @@ -15,6 +15,9 @@ fn main() { println!("cargo:rerun-if-changed={}", manifest.display()); println!("cargo:rustc-link-arg=/MANIFEST:EMBED"); println!("cargo:rustc-link-arg=/MANIFESTINPUT:{}", manifest.display()); + // Windows gives the main thread a 1 MB stack by default (macOS and Linux: 8 MB), which + // unoptimized debug frames overflow (STATUS_STACK_OVERFLOW). Match the 8 MB elsewhere. + println!("cargo:rustc-link-arg=/STACK:8388608"); } tauri_build::try_build(tauri_build::Attributes::new().windows_attributes(windows)).expect("tauri build"); }