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
This commit is contained in:
Dmitriy Vyukov 2014-03-13 17:41:08 +04:00
parent 1569628725
commit e678ab4e37
3 changed files with 17 additions and 0 deletions

View file

@ -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",