]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix stack split at bad time when disable inlining
authorWei Xiao <Wei.Xiao@arm.com>
Thu, 25 May 2017 05:59:39 +0000 (13:59 +0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 29 May 2017 19:10:39 +0000 (19:10 +0000)
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>

src/runtime/lock_futex.go

index 45d3da64a412204af1e834d82d77ca5f119137bf..9d55bd129c992188122ce536df593f209c06b527 100644 (file)
@@ -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))
 }