aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2014-03-19 17:04:51 +0400
committerDmitriy Vyukov <dvyukov@google.com>2014-03-19 17:04:51 +0400
commit1895014257138311efc6f79be93a8715f8809586 (patch)
tree54caf0d648e653aa7efbfd7fadf256a6350d8c06 /src/pkg/runtime/proc.c
parentcb502775107ce5f6f22e9b47c9c77300859864b4 (diff)
downloadgo-1895014257138311efc6f79be93a8715f8809586.tar.xz
runtime: fix stack split detection around fork
If runtime_BeforeFork splits stack, it will unsplit it with spoiled g->stackguard. It leads to check failure in oldstack: fatal error: stackfree: bad fixed size runtime stack: runtime.throw(0xadf3cd) runtime.stackfree(0xc208040480, 0xfffffffffffff9dd, 0x1b00fa8) runtime.oldstack() runtime.lessstack() goroutine 311 [stack unsplit]: syscall.forkAndExecInChild(0xc20802eea0, 0xc208192c00, 0x5, 0x5, 0xc208072a80, ...) syscall.forkExec(0xc20802ed80, 0x54, 0xc2081ccb40, 0x4, 0x4, ...) Fixes #7567. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews, khr, rsc https://golang.org/cl/77340045
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index e11f9b18ac..b5093497d9 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -1696,6 +1696,7 @@ exitsyscall0(G *gp)
}
// Called from syscall package before fork.
+#pragma textflag NOSPLIT
void
syscall·runtime_BeforeFork(void)
{