From 91a80cc174dc2b0df4cab12966c498ac435dbc31 Mon Sep 17 00:00:00 2001 From: Wei Xiao Date: Thu, 25 May 2017 13:59:39 +0800 Subject: [PATCH] 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 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/runtime/lock_futex.go | 1 + 1 file changed, 1 insertion(+) 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)) } -- 2.50.0