• Ian Lance Taylor's avatar
    runtime: always install new signal stack on NetBSD and DragonFly · 801bebef
    Ian Lance Taylor authored
    On NetBSD and DragonFly a newly created thread inherits the signal stack
    of the creating thread.  That means that in a cgo program a C thread
    created using pthread_create will get the signal stack of the creating
    thread, most likely a Go thread.  This will then lead to chaos if two
    signals occur simultaneously.
    
    We can't fix the general case.  But we can fix the case of a C thread
    that calls a Go function, by installing a new signal stack and then
    dropping it when we return to C.  That will break the case of a C thread
    that calls sigaltstack and then calls Go, because we will drop the C
    thread's alternate signal stack as we return from Go.  Still, this is
    the 1.5 behavior.  And what else can we do?
    
    Fixes #14051.
    Fixes #14052.
    Fixes #14067.
    
    Change-Id: Iee286ca50b50ec712a4d929c7121c35e2383a7b9
    Reviewed-on: https://go-review.googlesource.com/18835Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: 's avatarMikio Hara <mikioh.mikioh@gmail.com>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    801bebef
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...