From 038ff9dca156c92527167dd15f6da918b6f91648 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Fri, 1 Nov 2013 11:21:54 +1100 Subject: [PATCH] [release-branch.go1.2] runtime: relax preemption assertion during stack split MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ««« 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 #6644. R=golang-dev, r CC=golang-dev https://golang.org/cl/18740044 »»» R=golang-dev CC=golang-dev https://golang.org/cl/20460044 --- src/pkg/runtime/stack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c index 011c616bac..634706051c 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"); -- 2.48.1