diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 7581b35d0b..c7a8d24182 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -1223,6 +1223,10 @@ gosched0(G *gp) } // Finishes execution of the current goroutine. +// Need to mark it as nosplit, because it runs with sp > stackbase (as runtime·lessstack). +// Since it does not return it does not matter. But if it is preempted +// at the split stack check, GC will complain about inconsistent sp. +#pragma textflag 7 void runtime·goexit(void) {