]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.21] 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:08 +0000 (21:10 +0000)
commit6634ce2f418754b504b20ee57a42390186fceb96
treeefb48f350426fcca9ed64159332f805e77128950
parent25c6dce1882795b64988bdf634282e7512842650
[release-branch.go1.21] 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 #62019.
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/+/519375
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
src/runtime/cpuprof.go
src/runtime/os_darwin.go
src/runtime/profbuf.go