]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix crash on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Wed, 11 Oct 2017 23:39:46 +0000 (01:39 +0200)
committerAustin Clements <austin@google.com>
Thu, 12 Oct 2017 00:11:33 +0000 (00:11 +0000)
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 <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/proc.go

index d096df547ec88ac3e05c6bbc7a46f180165ea255..b41f0c5ef80b1ee329aec4605ba97856239b2898 100644 (file)
@@ -1170,10 +1170,10 @@ func mstart() {
        mstart1(0)
 
        // Exit this thread.
-       if GOOS == "windows" || GOOS == "solaris" {
-               // Windows and Solaris always system-allocate the
-               // stack, but put it in _g_.stack before mstart, so
-               // the logic above hasn't set osStack yet.
+       if GOOS == "windows" || GOOS == "solaris" || GOOS == "plan9" {
+               // Window, Solaris and Plan 9 always system-allocate
+               // the stack, but put it in _g_.stack before mstart,
+               // so the logic above hasn't set osStack yet.
                osStack = true
        }
        mexit(osStack)