mirror of
https://github.com/golang/go
synced 2024-11-18 06:14:46 -07:00
runtime: in newstack, double-check calling goroutine
Checking this condition helped me find the arm problem last night. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12267043
This commit is contained in:
parent
b8b48abe0f
commit
ebc5513be6
@ -201,6 +201,13 @@ runtime·newstack(void)
|
|||||||
bool reflectcall;
|
bool reflectcall;
|
||||||
uintptr free;
|
uintptr free;
|
||||||
|
|
||||||
|
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",
|
||||||
|
m->morebuf.g, m, m->curg, m->g0, m->gsignal);
|
||||||
|
runtime·throw("runtime: wrong goroutine in newstack");
|
||||||
|
}
|
||||||
|
|
||||||
// gp->status is usually Grunning, but it could be Gsyscall if a stack split
|
// gp->status is usually Grunning, but it could be Gsyscall if a stack split
|
||||||
// happens during a function call inside entersyscall.
|
// happens during a function call inside entersyscall.
|
||||||
gp = m->curg;
|
gp = m->curg;
|
||||||
|
Loading…
Reference in New Issue
Block a user