diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2014-03-06 21:33:19 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2014-03-06 21:33:19 +0400 |
| commit | 8ca3372d7b63c8c61ea68daa9e3fc63213eb7965 (patch) | |
| tree | 7027a2c567af6cbf33c93bbf63f89e8b8d8d540d /src/pkg | |
| parent | aea99eda0f88987e06c4ce9e0cf5bdee23b12a98 (diff) | |
| download | go-8ca3372d7b63c8c61ea68daa9e3fc63213eb7965.tar.xz | |
runtime: fix bad g status after copystack
LGTM=khr
R=khr
CC=golang-codereviews, rsc
https://golang.org/cl/69870054
Diffstat (limited to 'src/pkg')
| -rw-r--r-- | src/pkg/runtime/proc.c | 6 | ||||
| -rw-r--r-- | src/pkg/runtime/stack.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 6a65e590de..fdcbca4c32 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -1364,6 +1364,8 @@ top: void runtime·park(bool(*unlockf)(G*, void*), void *lock, int8 *reason) { + if(g->status != Grunning) + runtime·throw("bad g status"); m->waitlock = lock; m->waitunlockf = unlockf; g->waitreason = reason; @@ -1415,6 +1417,8 @@ park0(G *gp) void runtime·gosched(void) { + if(g->status != Grunning) + runtime·throw("bad g status"); runtime·mcall(runtime·gosched0); } @@ -1443,6 +1447,8 @@ runtime·gosched0(G *gp) void runtime·goexit(void) { + if(g->status != Grunning) + runtime·throw("bad g status"); if(raceenabled) runtime·racegoend(); runtime·mcall(goexit0); diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c index 85885e80f9..e3daed5f28 100644 --- a/src/pkg/runtime/stack.c +++ b/src/pkg/runtime/stack.c @@ -640,6 +640,7 @@ runtime·newstack(void) copystack(gp, nframes, newsize); if(StackDebug >= 1) runtime·printf("stack grow done\n"); + gp->status = oldstatus; runtime·gogo(&gp->sched); } // TODO: if stack is uncopyable because we're in C code, patch return value at |
