]> Cypherpunks repositories - gostls13.git/commit
runtime: on NetBSD and DragonFly drop signal stack in new thread
authorIan Lance Taylor <iant@golang.org>
Thu, 21 Jan 2016 20:38:05 +0000 (12:38 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 21 Jan 2016 23:21:47 +0000 (23:21 +0000)
commit4c4476c297e0a43bf92e8303da369cdc18e5745c
tree6cc1028788436b117eedcd64e03236a93672daa3
parent489f65b52ad28c2a6f4f2dc58a3d939e9a77be47
runtime: on NetBSD and DragonFly drop signal stack in new thread

On NetBSD and DragonFly a newly created thread inherits the signal stack
of the creating thread.  This breaks horribly if both threads get a
signal at the same time.  Fix this by dropping the signal stack in the
newly created thread.  The right signal stack will then get installed
later.

Note that cgo code that calls pthread_create will have the wrong,
duplicated, signal stack in the newly created thread.  I don't see any
way to fix that in Go.  People using cgo to call pthread_create will
have to be aware of the problem.

Fixes #13945.
Fixes #13947.

Change-Id: I0c7bd2cdf9ada575d57182ca5e9523060de34931
Reviewed-on: https://go-review.googlesource.com/18814
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/cgo/gcc_dragonfly_amd64.c
src/runtime/cgo/gcc_netbsd_386.c
src/runtime/cgo/gcc_netbsd_amd64.c
src/runtime/cgo/gcc_netbsd_arm.c
src/runtime/os1_netbsd.go
src/runtime/sys_dragonfly_amd64.s