These operations misbehave and cause hangs and flakes.
Fail hard if they are attempted.
Tested by backing out the Darwin-profiling-hang fix
CL 518836 and running run.bash, the guard panicked in
runtime/pprof tests, as expected/hoped.
Updates #61768
Change-Id: I89b6f85745fbaa2245141ea98f584afc5d6b133e
Reviewed-on: https://go-review.googlesource.com/c/go/+/519275
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
if ns >= 0 {
start = nanotime()
}
- mp := getg().m
+ g := getg()
+ mp := g.m
+ if g == mp.gsignal {
+ // sema sleep/wakeup are implemented with pthreads, which are not async-signal-safe on Darwin.
+ throw("semasleep on Darwin signal stack")
+ }
pthread_mutex_lock(&mp.mutex)
for {
if mp.count > 0 {
//go:nosplit
func semawakeup(mp *m) {
+ if g := getg(); g == g.m.gsignal {
+ throw("semawakeup on Darwin signal stack")
+ }
pthread_mutex_lock(&mp.mutex)
mp.count++
if mp.count > 0 {