• Austin Clements's avatar
    runtime: don't try to free OS-created signal stacks · 44d9e96d
    Austin Clements authored
    Android's libc creates a signal stack for every thread it creates. In
    Go, minitSignalStack picks up this existing signal stack and puts it
    in m.gsignal.stack. However, if we later try to exit a thread (because
    a locked goroutine is exiting), we'll attempt to stackfree this
    libc-allocated signal stack and panic.
    
    Fix this by clearing gsignal.stack when we unminitSignals in such a
    situation.
    
    This should fix the Android build, which is currently broken.
    
    Change-Id: Ieea8d72ef063d22741c54c9daddd8bb84926a488
    Reviewed-on: https://go-review.googlesource.com/70130Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    Run-TryBot: David Crawshaw <crawshaw@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    44d9e96d
signal_unix.go 23.3 KB