From: Austin Clements Date: Thu, 6 Jan 2022 20:25:01 +0000 (-0500) Subject: runtime: improve asanread/asanwrite nosplit comment X-Git-Tag: go1.18beta2~121 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1cc3c735802f93eaf74b21795b8027163318ace1;p=gostls13.git runtime: improve asanread/asanwrite nosplit comment Explain the conditions under which they are called on stacks that cannot grow. Change-Id: I08ee5480face7fbedeccc09e55b8149c5a793c2e Reviewed-on: https://go-review.googlesource.com/c/go/+/376036 Trust: Austin Clements Reviewed-by: Ian Lance Taylor Reviewed-by: Cherry Mui Reviewed-by: Fannie Zhang --- diff --git a/src/runtime/asan.go b/src/runtime/asan.go index 26656cd975..5f1e6370d2 100644 --- a/src/runtime/asan.go +++ b/src/runtime/asan.go @@ -26,8 +26,9 @@ func ASanWrite(addr unsafe.Pointer, len int) { // Private interface for the runtime. const asanenabled = true -// Mark asan(read, write) as NOSPLIT, because they may run -// on stacks that cannot grow. See issue #50391. +// asan{read,write} are nosplit because they may be called between +// fork and exec, when the stack must not grow. See issue #50391. + //go:nosplit func asanread(addr unsafe.Pointer, sz uintptr) { sp := getcallersp()