Skip to content

Commit be589f8

Browse files
committed
runtime: fix final stack split in exitsyscall
exitsyscall should be recursively nosplit, but we don't have a way to annotate that right now (see #21314). There's exactly one remaining place where this is violated right now: exitsyscall -> casgstatus -> print. The other prints in casgstatus are wrapped in systemstack calls. This fixes the remaining print. Updates #21431 (in theory could fix it, but that would just indicate that we have a different G status-related crash and we've *never* seen that failure on the dashboard.) Change-Id: I9a5e8d942adce4a5c78cfc6b306ea5bda90dbd33 Reviewed-on: https://go-review.googlesource.com/79815 Run-TryBot: Austin Clements <[email protected]> Reviewed-by: Rick Hudson <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 2e1f071 commit be589f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/runtime/proc.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,10 @@ func casgstatus(gp *g, oldval, newval uint32) {
782782
// _Grunning or _Grunning|_Gscan; either way,
783783
// we own gp.gcscanvalid, so it's safe to read.
784784
// gp.gcscanvalid must not be true when we are running.
785-
print("runtime: casgstatus ", hex(oldval), "->", hex(newval), " gp.status=", hex(gp.atomicstatus), " gp.gcscanvalid=true\n")
786-
throw("casgstatus")
785+
systemstack(func() {
786+
print("runtime: casgstatus ", hex(oldval), "->", hex(newval), " gp.status=", hex(gp.atomicstatus), " gp.gcscanvalid=true\n")
787+
throw("casgstatus")
788+
})
787789
}
788790

789791
// See http://golang.org/cl/21503 for justification of the yield delay.

0 commit comments

Comments
 (0)