diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 7a2283e360..6348335804 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -5769,15 +5769,23 @@ func wirep(pp *p) { gp := getg() if gp.m.p != 0 { - throw("wirep: already in go") + // Call on the systemstack to avoid a nosplit overflow build failure + // on some platforms when built with -N -l. See #64113. + systemstack(func() { + throw("wirep: already in go") + }) } if pp.m != 0 || pp.status != _Pidle { - id := int64(0) - if pp.m != 0 { - id = pp.m.ptr().id - } - print("wirep: p->m=", pp.m, "(", id, ") p->status=", pp.status, "\n") - throw("wirep: invalid p state") + // Call on the systemstack to avoid a nosplit overflow build failure + // on some platforms when built with -N -l. See #64113. + systemstack(func() { + id := int64(0) + if pp.m != 0 { + id = pp.m.ptr().id + } + print("wirep: p->m=", pp.m, "(", id, ") p->status=", pp.status, "\n") + throw("wirep: invalid p state") + }) } gp.m.p.set(pp) pp.m.set(gp.m)