]> Cypherpunks repositories - gostls13.git/commit
runtime: always use Go signal stack in non-cgo program
authorCherry Zhang <cherryyz@google.com>
Sat, 16 Nov 2019 22:08:11 +0000 (17:08 -0500)
committerCherry Zhang <cherryyz@google.com>
Mon, 18 Nov 2019 18:18:46 +0000 (18:18 +0000)
commit73d20f8186a091c8d7e81b621136770981cf8e44
tree0ff2c82fbabb9d4c15659ade016f7f1dbbbf55e9
parentf9dd99cae3b08e2fea303b88ff6ffae6261f65b5
runtime: always use Go signal stack in non-cgo program

When initializing an M, we set up its signal stack to the gsignal
stack if an alternate signal stack is not already set. On Android,
an alternate signal stack is always set, even cgo is not used.
This breaks the logic of saving/fetching G on the signal stack
during VDSO, which assumes the signal stack is allocated by Go if
cgo is not used (if cgo is used, we use TLS for saving G).

When cgo is not used, we can always use the Go signal stack, even
if an alternate signal stack is already set. Since cgo is not
used, no one other than the Go runtime will care.

Fixes #35554.

Change-Id: Ia9d84cd55cb35097f3df46f37996589c86f10e0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/207445
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/signal_unix.go