]> Cypherpunks repositories - gostls13.git/commit
runtime: if we don't handle a signal on a non-Go thread, raise it
authorIan Lance Taylor <iant@golang.org>
Wed, 22 Jul 2015 05:34:48 +0000 (22:34 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 22 Jul 2015 20:26:29 +0000 (20:26 +0000)
commit872b168fe344914550c29b4f1b0cac9f2e70e7fc
treee877af2c1cd05cbeecc98224b21edb66123879de
parent428ed1e3d9e31428b3bf81ed55664a4c34238e4c
runtime: if we don't handle a signal on a non-Go thread, raise it

In the past badsignal would crash the program.  In
https://golang.org/cl/10757044 badsignal was changed to call sigsend,
to fix issue #3250.  The effect of this was that when a non-Go thread
received a signal, and os/signal.Notify was not being used to check
for occurrences of the signal, the signal was ignored.

This changes the code so that if os/signal.Notify is not being used,
then the signal handler is reset to what it was, and the signal is
raised again.  This lets non-Go threads handle the signal as they
wish.  In particular, it means that a segmentation violation in a
non-Go thread will ordinarily crash the process, as it should.

Fixes #10139.
Update #11794.

Change-Id: I2109444aaada9d963ad03b1d071ec667760515e5
Reviewed-on: https://go-review.googlesource.com/12503
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
26 files changed:
src/runtime/crash_cgo_test.go
src/runtime/os1_darwin.go
src/runtime/os1_dragonfly.go
src/runtime/os1_freebsd.go
src/runtime/os1_linux.go
src/runtime/os1_nacl.go
src/runtime/os1_netbsd.go
src/runtime/os1_openbsd.go
src/runtime/os1_plan9.go
src/runtime/os2_dragonfly.go
src/runtime/os2_freebsd.go
src/runtime/os2_linux.go
src/runtime/os2_solaris.go
src/runtime/os3_solaris.go
src/runtime/os_darwin.go
src/runtime/os_dragonfly.go
src/runtime/os_freebsd.go
src/runtime/os_linux.go
src/runtime/signal1_unix.go
src/runtime/signal_windows.go
src/runtime/sigqueue.go
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_linux_amd64.s