diff options
| author | Austin Clements <austin@google.com> | 2021-09-15 17:14:21 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2021-11-05 00:52:08 +0000 |
| commit | 35c7234601c409a1d1595e4eb9fe72e8ba4e6464 (patch) | |
| tree | 3346272b73bfe839753e0af3a4e77d5874a63424 /src/runtime/stack.go | |
| parent | 3839b6001470f7bc73c9a80f6458f7111ae3d9cc (diff) | |
| download | go-35c7234601c409a1d1595e4eb9fe72e8ba4e6464.tar.xz | |
runtime: add always-preempt maymorestack hook
This adds a maymorestack hook that forces a preemption at every
possible cooperative preemption point. This would have helped us catch
several recent preemption-related bugs earlier, including #47302,
#47304, and #47441.
For #48297.
Change-Id: Ib82c973589c8a7223900e1842913b8591938fb9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/359796
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime/stack.go')
| -rw-r--r-- | src/runtime/stack.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go index 52d21e4ee4..7d9ae1e9d2 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -144,6 +144,9 @@ const ( // Force a stack movement. Used for debugging. // 0xfffffeed in hex. stackForceMove = uintptrMask & -275 + + // stackPoisonMin is the lowest allowed stack poison value. + stackPoisonMin = uintptrMask & -4096 ) // Global pool of spans that have free stacks. |
