Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13)

Issue 4230044: code review 4230044: runtime: fix signal stack bug (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by rsc
Modified:
14 years ago
Reviewers:
CC:
bradfitz, r, r2, golang-dev
Visibility:
Public.

Description

runtime: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -9 lines) Patch
M src/Make.pkg View 1 1 chunk +1 line, -3 lines 0 comments Download
M src/pkg/runtime/Makefile View 1 2 chunks +4 lines, -3 lines 0 comments Download
M src/pkg/runtime/darwin/thread.c View 1 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/runtime/freebsd/thread.c View 1 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/runtime/linux/thread.c View 1 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 3
rsc
Hello bradfitzgo, r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg
14 years ago (2011-02-24 21:34:45 UTC) #1
r2
LGTM
14 years ago (2011-02-24 21:44:16 UTC) #2
rsc
14 years ago (2011-02-24 21:46:47 UTC) #3
*** Submitted as 7bb9f06500d3 ***

runtime: 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.

R=bradfitzgo, r, r2
CC=golang-dev
http://codereview.appspot.com/4230044
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b