aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_unix.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-11-22 21:58:57 -0500
committerAustin Clements <austin@google.com>2017-11-23 03:05:56 +0000
commit294963fb7f8983c7f5560dc20ab75c869f30da14 (patch)
treecf8a809df4ce8d0a5a3b34c07456d15a83365999 /src/runtime/signal_unix.go
parentb6cf58d5b82898a2c92d50aead07163d5bc3c184 (diff)
downloadgo-294963fb7f8983c7f5560dc20ab75c869f30da14.tar.gz
go-294963fb7f8983c7f5560dc20ab75c869f30da14.zip
runtime: document sigtrampgo better
Add an explanation of why sigtrampgo is nosplit. Updates #21314. Change-Id: I3f5909d2b2c180f9fa74d53df13e501826fd4316 Reviewed-on: https://go-review.googlesource.com/79615 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/signal_unix.go')
-rw-r--r--src/runtime/signal_unix.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go
index a616d46bac..9dae058f2c 100644
--- a/src/runtime/signal_unix.go
+++ b/src/runtime/signal_unix.go
@@ -275,6 +275,12 @@ func sigpipe() {
// sigtrampgo is called from the signal handler function, sigtramp,
// written in assembly code.
// This is called by the signal handler, and the world may be stopped.
+//
+// It must be nosplit because getg() is still the G that was running
+// (if any) when the signal was delivered, but it's (usually) called
+// on the gsignal stack. Until this switches the G to gsignal, the
+// stack bounds check won't work.
+//
//go:nosplit
//go:nowritebarrierrec
func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {