From 893964b9727a3dfcadab75c0f6b3c6b683b9bae0 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 16 Nov 2022 12:56:40 -0800 Subject: runtime,cmd/link: increase stack guard space when building with -race More stuff to do = more stack needed. Bump up the guard space when building with the race detector. Fixes #54291 Change-Id: I701bc8800507921bed568047d35b8f49c26e7df7 Reviewed-on: https://go-review.googlesource.com/c/go/+/451217 Run-TryBot: Keith Randall Reviewed-by: Keith Randall TryBot-Result: Gopher Robot Reviewed-by: Michael Knyszek --- src/runtime/stack.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/runtime/stack.go') diff --git a/src/runtime/stack.go b/src/runtime/stack.go index 546f997881..d5e587a209 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -98,6 +98,7 @@ const ( // The guard leaves enough room for one _StackSmall frame plus // a _StackLimit chain of NOSPLIT calls plus _StackSystem // bytes for the OS. + // This arithmetic must match that in cmd/internal/objabi/stack.go:StackLimit. _StackGuard = 928*sys.StackGuardMultiplier + _StackSystem // After a stack split check the SP is allowed to be this @@ -107,6 +108,7 @@ const ( // The maximum number of bytes that a chain of NOSPLIT // functions can use. + // This arithmetic must match that in cmd/internal/objabi/stack.go:StackLimit. _StackLimit = _StackGuard - _StackSystem - _StackSmall ) -- cgit v1.3