mirror of
https://github.com/golang/go
synced 2024-11-25 09:57:57 -07:00
runtime: fix crash when returning from syscall during gc
gp->m can go from non-nil to nil when it re-enters schedule(). R=golang-dev CC=golang-dev, rsc https://golang.org/cl/5245042
This commit is contained in:
parent
4b749567b8
commit
8584445289
@ -597,6 +597,7 @@ handoff(Workbuf *b)
|
||||
static void
|
||||
scanstack(void (*scanblock)(byte*, int64), G *gp)
|
||||
{
|
||||
M *mp;
|
||||
int32 n;
|
||||
Stktop *stk;
|
||||
byte *sp, *guard;
|
||||
@ -607,8 +608,8 @@ scanstack(void (*scanblock)(byte*, int64), G *gp)
|
||||
if(gp == g) {
|
||||
// Scanning our own stack: start at &gp.
|
||||
sp = (byte*)&gp;
|
||||
} else if(gp->m != nil && gp->m->helpgc) {
|
||||
// Gc helper scans its own stack.
|
||||
} else if((mp = gp->m) != nil && mp->helpgc) {
|
||||
// gchelper's stack is in active use and has no interesting pointers.
|
||||
return;
|
||||
} else {
|
||||
// Scanning another goroutine's stack.
|
||||
|
Loading…
Reference in New Issue
Block a user