• Russ Cox's avatar
    runtime: fix signal stack bug · 820dc9ff
    Russ Cox authored
    In CL 4188061 I changed malg to allocate the requested
    number of bytes n, not n+StackGuard, so that the
    allocations would use rounder numbers.
    
    The allocation of the signal stack asks for 32k and
    then used g->stackguard as the base, but g->stackguard
    is StackGuard bytes above the base.  Previously, asking
    for 32k meant getting 32k+StackGuard bytes, so using
    g->stackguard as the base was safe.  Now, the actual base
    must be computed, so that the signal handler does not
    run StackGuard bytes past the top of the stack.
    
    Was causing flakiness mainly in programs that use the
    network, because they sometimes write to closed network
    connections, causing SIGPIPEs.  Was also causing problems
    in the doc/progs test.
    
    Also fix Makefile so that changes to stack.h trigger rebuild.
    
    R=bradfitzgo, r, r2
    CC=golang-dev
    https://golang.org/cl/4230044
    820dc9ff
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...