From e678ab4e375659fea86b17557c23673033cf897c Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Thu, 13 Mar 2014 17:41:08 +0400 Subject: 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 --- src/pkg/runtime/stack.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pkg/runtime/stack.c') 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", -- cgit v1.3