src/runtime/stack1.go | 6 ++++++ diff --git a/src/runtime/stack1.go b/src/runtime/stack1.go index efcb5f25fada67a8a95445fe477c30e36fbfabcd..19634ef6d58a12d57b683c2615e6460ec92b748e 100644 --- a/src/runtime/stack1.go +++ b/src/runtime/stack1.go @@ -609,6 +609,10 @@ if stackDebug >= 1 { print("copystack gp=", gp, " [", hex(old.lo), " ", hex(old.hi-used), " ", hex(old.hi), "]/", gp.stackAlloc, " -> [", hex(new.lo), " ", hex(new.hi-used), " ", hex(new.hi), "]/", newsize, "\n") } + // Disallow sigprof scans of this stack and block if there's + // one in progress. + gcLockStackBarriers(gp) + // adjust pointers in the to-be-copied frames var adjinfo adjustinfo adjinfo.old = old @@ -639,6 +643,8 @@ gp.sched.sp = new.hi - used oldsize := gp.stackAlloc gp.stackAlloc = newsize gp.stkbar = newstkbar + + gcUnlockStackBarriers(gp) // free old stack if stackPoisonCopy != 0 {