• Ian Lance Taylor's avatar
    runtime: on NetBSD and DragonFly drop signal stack in new thread · 4c4476c2
    Ian Lance Taylor authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    4c4476c2
sys_dragonfly_amd64.s 7.35 KB