aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/stack.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2014-03-13 17:41:08 +0400
committerDmitriy Vyukov <dvyukov@google.com>2014-03-13 17:41:08 +0400
commite678ab4e375659fea86b17557c23673033cf897c (patch)
tree4572fb56152de8e44ae6482a9a45cd2743220ecd /src/pkg/runtime/stack.c
parent156962872575382697a0487030cd5777312d6d0c (diff)
downloadgo-e678ab4e375659fea86b17557c23673033cf897c.tar.xz
runtime: detect stack split after fork
This check would allowed to easily prevent issue 7511. Update #7511 LGTM=rsc R=rsc, aram CC=golang-codereviews https://golang.org/cl/75260043
Diffstat (limited to 'src/pkg/runtime/stack.c')
-rw-r--r--src/pkg/runtime/stack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c
index bb7a32f8ae..d580665e2b 100644
--- a/src/pkg/runtime/stack.c
+++ b/src/pkg/runtime/stack.c
@@ -583,6 +583,8 @@ runtime·newstack(void)
Gobuf label;
bool newstackcall;
+ if(m->forkstackguard)
+ runtime·throw("split stack after fork");
if(m->morebuf.g != m->curg) {
runtime·printf("runtime: newstack called from g=%p\n"
"\tm=%p m->curg=%p m->g0=%p m->gsignal=%p\n",