diff options
author | Wei Xiao <Wei.Xiao@arm.com> | 2017-05-25 13:59:39 +0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2017-05-29 19:10:39 +0000 |
commit | 91a80cc174dc2b0df4cab12966c498ac435dbc31 (patch) | |
tree | 94b1b04d46a66bbcc67e7244ecdefcb584751d07 /src/runtime/lock_futex.go | |
parent | 9acd814c2a53a10de39a891bf7b6f4d12fc7b329 (diff) | |
download | go-91a80cc174dc2b0df4cab12966c498ac435dbc31.tar.gz go-91a80cc174dc2b0df4cab12966c498ac435dbc31.zip |
runtime: fix stack split at bad time when disable inlining
key32 is called between entersyscallblock and exitsyscall
stack split may occur if disable inlining and the G is preempted
Fix the problem by describing key32 as nosplit function
Fixes #20510
Change-Id: I1f0787995936f34ef0052cf79fde036f1b338865
Reviewed-on: https://go-review.googlesource.com/44390
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/lock_futex.go')
-rw-r--r-- | src/runtime/lock_futex.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/lock_futex.go b/src/runtime/lock_futex.go index 45d3da64a4..9d55bd129c 100644 --- a/src/runtime/lock_futex.go +++ b/src/runtime/lock_futex.go @@ -38,6 +38,7 @@ const ( // affect mutex's state. // We use the uintptr mutex.key and note.key as a uint32. +//go:nosplit func key32(p *uintptr) *uint32 { return (*uint32)(unsafe.Pointer(p)) } |