Skip to content

Commit 25f042d

Browse files
rscgopherbot
authored andcommitted
[release-branch.go1.23] runtime: reserve 4kB for system stack on windows-386
The failures in #70288 are consistent with and strongly imply stack corruption during fault handling, and debug prints show that the Go code run during fault handling is running about 300 bytes above the bottom of the goroutine stack. That should be okay, but that implies the DLL code that called Go's handler was running near the bottom of the stack too, and maybe it called other deeper things before or after the Go handler and smashed the stack that way. stackSystem is already 4096 bytes on amd64; making it match that on 386 makes the flaky failures go away. It's a little unsatisfying not to be able to say exactly what is overflowing the stack, but the circumstantial evidence is very strong that it's Windows. For #70288. Fixes #70475. Change-Id: Ife89385873d5e5062a71629dbfee40825edefa49 Reviewed-on: https://go-review.googlesource.com/c/go/+/627375 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Russ Cox <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> (cherry picked from commit 7eeb0a1) Reviewed-on: https://go-review.googlesource.com/c/go/+/632196 Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Veronica Silina <[email protected]>
1 parent be062b7 commit 25f042d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/stack.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const (
6969
// to each stack below the usual guard area for OS-specific
7070
// purposes like signal handling. Used on Windows, Plan 9,
7171
// and iOS because they do not use a separate stack.
72-
stackSystem = goos.IsWindows*512*goarch.PtrSize + goos.IsPlan9*512 + goos.IsIos*goarch.IsArm64*1024
72+
stackSystem = goos.IsWindows*4096 + goos.IsPlan9*512 + goos.IsIos*goarch.IsArm64*1024
7373

7474
// The minimum size of stack used by Go code
7575
stackMin = 2048
@@ -1330,7 +1330,7 @@ func morestackc() {
13301330
}
13311331

13321332
// startingStackSize is the amount of stack that new goroutines start with.
1333-
// It is a power of 2, and between _FixedStack and maxstacksize, inclusive.
1333+
// It is a power of 2, and between fixedStack and maxstacksize, inclusive.
13341334
// startingStackSize is updated every GC by tracking the average size of
13351335
// stacks scanned during the GC.
13361336
var startingStackSize uint32 = fixedStack

0 commit comments

Comments
 (0)