]> Cypherpunks repositories - gostls13.git/commit
runtime: crash if a signal is received with bad G and no extra M
authorCherry Zhang <cherryyz@google.com>
Thu, 14 Nov 2019 02:01:01 +0000 (21:01 -0500)
committerCherry Zhang <cherryyz@google.com>
Fri, 15 Nov 2019 02:31:52 +0000 (02:31 +0000)
commit03c58c9dccde0b9d98962f34e6669a508c8d133a
tree8738d71ba2bc11ce86005e70bff33b66d30fb023
parent7719016ee297dd4960bb66ed265038f2d75b3c56
runtime: crash if a signal is received with bad G and no extra M

When we receive a signal, if G is nil we call badsignal, which
calls needm. When cgo is not used, there is no extra M, so needm
will just hang. In this situation, even GOTRACEBACK=crash cannot
get a stack trace, as we're in the signal handler and cannot
receive another signal (SIGQUIT).

Instead, just crash.

For #35554.
Updates #34391.

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