Descriptionruntime: fix signal stack bug
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.
Patch Set 1 #Patch Set 2 : diff -r b8b3a9337979 https://go.googlecode.com/hg #Patch Set 3 : diff -r b8b3a9337979 https://go.googlecode.com/hg #Patch Set 4 : diff -r b0e4832734b3 https://go.googlecode.com/hg #
MessagesTotal messages: 3
|