]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: profiling on Darwin cannot use blocking reads
authorDavid Chase <drchase@google.com>
Fri, 11 Aug 2023 18:38:19 +0000 (14:38 -0400)
committerDavid Chase <drchase@google.com>
Mon, 14 Aug 2023 15:41:38 +0000 (15:41 +0000)
commitc6ee8e31e3e7b01da54d241ae5a8eed350ab0e9f
tree76b97aefa511a0be52e7f8a15cbc82457a122fd8
parent98bacdeafe089f917d98d2151694568e4a25a4c3
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 #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>
src/runtime/cpuprof.go
src/runtime/os_darwin.go
src/runtime/profbuf.go