]> Cypherpunks repositories - gostls13.git/commit
runtime: fix bad signal stack when using cgo-created threads and async signals
authorRuss Cox <rsc@golang.org>
Fri, 13 Nov 2015 21:21:01 +0000 (16:21 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 18 Nov 2015 18:05:22 +0000 (18:05 +0000)
commitf8e6418637c8163d9046ccf700d3486000fddb26
treea0ba2b611b36dfcb86166c16b5b6fd308e6460ef
parent921e7dfd06f8b6d3fa15700fede98044cd2db8c4
runtime: fix bad signal stack when using cgo-created threads and async signals

Cgo-created threads transition between having associated Go g's and m's and not.
A signal arriving during the transition could think it was safe and appropriate to
run Go signal handlers when it was in fact not.
Avoid the race by masking all signals during the transition.

Fixes #12277.

Change-Id: Ie9711bc1d098391d58362492197a7e0f5b497d14
Reviewed-on: https://go-review.googlesource.com/16915
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/os1_darwin.go
src/runtime/os1_dragonfly.go
src/runtime/os1_freebsd.go
src/runtime/os1_linux.go
src/runtime/os1_nacl.go
src/runtime/os1_netbsd.go
src/runtime/os1_openbsd.go
src/runtime/os1_plan9.go
src/runtime/os1_windows.go
src/runtime/os3_solaris.go
src/runtime/proc.go