aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_solaris_amd64.go
diff options
context:
space:
mode:
authorJoe Sylve <joe.sylve@gmail.com>2016-03-22 22:11:42 -0500
committerIan Lance Taylor <iant@golang.org>2016-03-24 19:34:17 +0000
commitdf2b2eb63db3f771c41be4d97ac6fb6b0c5f8c48 (patch)
tree562b13708225cadb605d4abf10afdb692e32fd54 /src/runtime/signal_solaris_amd64.go
parentfb49655d7b3a319dfbf48ad55dd7951a91668949 (diff)
downloadgo-df2b2eb63db3f771c41be4d97ac6fb6b0c5f8c48.tar.gz
go-df2b2eb63db3f771c41be4d97ac6fb6b0c5f8c48.zip
runtime: improve last ditch signal forwarding for Unix libraries
The current runtime attempts to forward signals generated by non-Go code to the original signal handler. If it can't call the original handler directly, it currently attempts to re-raise the signal after resetting the handler. In this case, the original context is lost. This fix prevents that problem by simply returning from the go signal handler after resetting the original handler. It only does this when the original handler is the system default handler, which in all cases is known to not recover. The signal is not reset, so it is retriggered and the original handler takes over with the proper context. Fixes #14899 Change-Id: Ib1c19dfa4b50d9732d7a453de3784c8141e1cbb3 Reviewed-on: https://go-review.googlesource.com/21006 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/signal_solaris_amd64.go')
-rw-r--r--src/runtime/signal_solaris_amd64.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/signal_solaris_amd64.go b/src/runtime/signal_solaris_amd64.go
index a577c8c199..7ba368f25b 100644
--- a/src/runtime/signal_solaris_amd64.go
+++ b/src/runtime/signal_solaris_amd64.go
@@ -11,6 +11,10 @@ type sigctxt struct {
ctxt unsafe.Pointer
}
+func makesigctxt(info *siginfo, ctxt unsafe.Pointer) *sigctxt {
+ return &sigctxt{info, ctxt}
+}
+
func (c *sigctxt) regs() *mcontext {
return (*mcontext)(unsafe.Pointer(&(*ucontext)(c.ctxt).uc_mcontext))
}