]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.20] runtime: profiling on Darwin cannot use blocking reads
authorDavid Chase <drchase@google.com>
Fri, 11 Aug 2023 18:38:19 +0000 (14:38 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 17 Aug 2023 21:10:05 +0000 (21:10 +0000)
commitb4636682759ea7cd7a8ed480e4f98f401127306f
treeb96b581c830e65ab9a73c007db3cc65d26cf7985
parent974a3c9af7943a2c994d713c410bcadd7dca77b4
[release-branch.go1.20] runtime: profiling on Darwin cannot use blocking reads

On Darwin (and assume also on iOS but not sure), notetsleepg
cannot be called in a signal-handling context.  Avoid this
by disabling block reads on Darwin.

An alternate approach was to add "sigNote" with a pipe-based
implementation on Darwin, but that ultimately would have required
at least one more linkname between runtime and syscall to avoid
racing with fork and opening the pipe, so, not.

Fixes #62018.
Updates #61768.

Change-Id: I0e8dd4abf9a606a3ff73fc37c3bd75f55924e07e
Reviewed-on: https://go-review.googlesource.com/c/go/+/518836
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
(cherry picked from commit c6ee8e31e3e7b01da54d241ae5a8eed350ab0e9f)
Reviewed-on: https://go-review.googlesource.com/c/go/+/518677
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/cpuprof.go
src/runtime/os_darwin.go
src/runtime/profbuf.go