Skip to content

Commit 926373e

Browse files
0introaclements
authored andcommitted
runtime: fix crash on Plan 9
Since CL 46037, the runtime is crashing after calling exitThread on Plan 9. The exitThread function shouldn't be called on Plan 9, because the system manages thread stacks. Fixes #22221. Change-Id: I5d61c9660a87dc27e4cfcb3ca3ddcb4b752f2397 Reviewed-on: https://go-review.googlesource.com/70190 Run-TryBot: David du Colombier <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Austin Clements <[email protected]>
1 parent a509cae commit 926373e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/runtime/proc.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,10 +1170,10 @@ func mstart() {
11701170
mstart1(0)
11711171

11721172
// Exit this thread.
1173-
if GOOS == "windows" || GOOS == "solaris" {
1174-
// Windows and Solaris always system-allocate the
1175-
// stack, but put it in _g_.stack before mstart, so
1176-
// the logic above hasn't set osStack yet.
1173+
if GOOS == "windows" || GOOS == "solaris" || GOOS == "plan9" {
1174+
// Window, Solaris and Plan 9 always system-allocate
1175+
// the stack, but put it in _g_.stack before mstart,
1176+
// so the logic above hasn't set osStack yet.
11771177
osStack = true
11781178
}
11791179
mexit(osStack)

0 commit comments

Comments
 (0)