summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2013-11-01 11:21:54 +1100
committerAndrew Gerrand <adg@golang.org>2013-11-01 11:21:54 +1100
commitdab29b8b00aaba5103cb9607178e29308631473f (patch)
tree7851b6c31466cd6ca4758f1db9a43d2076eb156b
parent86703d4624b71bf34c346c051b72b641a23422f8 (diff)
downloadgo-dab29b8b00aaba5103cb9607178e29308631473f.tar.gz
[release-branch.go1.2] runtime: relax preemption assertion during stack split
??? CL 18740044 / 1a8903f0a577 runtime: relax preemption assertion during stack split The case can happen when starttheworld is calling acquirep to get things moving again and acquirep gets preempted. The stack trace is in golang.org/issue/6644. It is difficult to build a short test case for this, but the person who reported issue 6644 confirms that this solves the problem. Fixes issue 6644. R=golang-dev, r CC=golang-dev https://codereview.appspot.com/18740044 ??? R=golang-dev CC=golang-dev https://codereview.appspot.com/20460044
-rw-r--r--src/pkg/runtime/stack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c
index 011c616ba..634706051 100644
--- a/src/pkg/runtime/stack.c
+++ b/src/pkg/runtime/stack.c
@@ -255,7 +255,7 @@ runtime·newstack(void)
if(gp->stackguard0 == (uintptr)StackPreempt) {
if(gp == m->g0)
runtime·throw("runtime: preempt g0");
- if(oldstatus == Grunning && m->p == nil)
+ if(oldstatus == Grunning && m->p == nil && m->locks == 0)
runtime·throw("runtime: g is running but p is not");
if(oldstatus == Gsyscall && m->locks == 0)
runtime·throw("runtime: stack split during syscall");