]> Cypherpunks repositories - gostls13.git/commit
runtime: adjust gsignal stack to current signal stack
authorIan Lance Taylor <iant@golang.org>
Tue, 22 Dec 2015 06:27:01 +0000 (22:27 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 24 Dec 2015 17:00:04 +0000 (17:00 +0000)
commitf7e51c132059a78953b768ca66e457b40985930e
treee83f12442cc839b5f2d80c14c3b7131666bc9746
parente4dcf5c8c22d98ac9eac7b9b226596229624cb1d
runtime: adjust gsignal stack to current signal stack

If non-Go code calls sigaltstack before a signal is received, use
sigaltstack to determine the current signal stack and set the gsignal
stack to use it.  This makes the Go runtime more robust in the face of
non-Go code.  We still can't handle a disabled signal stack or a signal
triggered with SA_ONSTACK clear, but we now give clear errors for those
cases.

Fixes #7227.
Update #9896.

Change-Id: Icb1607e01fd6461019b6d77d940e59b3aed4d258
Reviewed-on: https://go-review.googlesource.com/18102
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
23 files changed:
misc/cgo/test/cgo_unix_test.go [new file with mode: 0644]
misc/cgo/test/sigaltstack.go [new file with mode: 0644]
src/runtime/signal1_unix.go
src/runtime/signal2_unix.go
src/runtime/signal_darwin.go
src/runtime/signal_freebsd.go
src/runtime/signal_linux.go [deleted file]
src/runtime/signal_openbsd.go
src/runtime/signal_sigtramp.go [new file with mode: 0644]
src/runtime/sys_darwin_386.s
src/runtime/sys_darwin_arm.s
src/runtime/sys_darwin_arm64.s
src/runtime/sys_dragonfly_amd64.s
src/runtime/sys_freebsd_386.s
src/runtime/sys_freebsd_amd64.s
src/runtime/sys_freebsd_arm.s
src/runtime/sys_netbsd_386.s
src/runtime/sys_netbsd_amd64.s
src/runtime/sys_netbsd_arm.s
src/runtime/sys_openbsd_386.s
src/runtime/sys_openbsd_amd64.s
src/runtime/sys_openbsd_arm.s
src/runtime/sys_solaris_amd64.s