• Austin Clements's avatar
    runtime: make GOTRACEBACK=crash crash promptly in cgo binaries · f2e87158
    Austin Clements authored
    GOTRACEBACK=crash works by bouncing a SIGQUIT around the process
    sched.mcount times. However, sched.mcount includes the extra Ms
    allocated by oneNewExtraM for cgo callbacks. Hence, if there are any
    extra Ms that don't have real OS threads, we'll try to send SIGQUIT
    more times than there are threads to catch it. Since nothing will
    catch these extra signals, we'll fall back to blocking for five
    seconds before aborting the process.
    
    Avoid this five second delay by subtracting out the number of extra Ms
    when sending SIGQUITs.
    
    Of course, in a cgo binary, it's still possible for the SIGQUIT to go
    to a cgo thread and cause some other failure mode. This does not fix
    that.
    
    Change-Id: I4fbf3c52dd721812796c4c1dcb2ab4cb7026d965
    Reviewed-on: https://go-review.googlesource.com/38182
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    f2e87158
Name
Last commit
Last update
.github Loading commit data...
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...