]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "runtime: set stackguard1 on extra M g0"
authorMichael Pratt <mpratt@google.com>
Mon, 11 Sep 2023 16:17:40 +0000 (12:17 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 11 Sep 2023 16:35:54 +0000 (16:35 +0000)
This reverts CL 527056.

CL 525455 breaks darwin, alpine, and android. This CL must be reverted
in order to revert that CL.

For #62440.

Change-Id: I4e1b16e384b475a605e0214ca36c918d50faa22c
Reviewed-on: https://go-review.googlesource.com/c/go/+/527316
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/runtime/cgocall.go
src/runtime/runtime2.go

index e4da34b31d5c309b6e32c7ea4a006ac00dc4fc05..debd8cf5e8a59877fccafbcd60ae8035a6f4001b 100644 (file)
@@ -233,7 +233,6 @@ func callbackUpdateSystemStack(mp *m, sp uintptr, signal bool) {
                g0.stack.hi = sp + 1024
                g0.stack.lo = sp - 32*1024
                g0.stackguard0 = g0.stack.lo + stackGuard
-               g0.stackguard1 = g0.stackguard0
 
                print("M ", mp.id, " procid ", mp.procid, " runtime: cgocallback with sp=", hex(sp), " out of bounds [", hex(lo), ", ", hex(hi), "]")
                print("\n")
@@ -272,7 +271,6 @@ func callbackUpdateSystemStack(mp *m, sp uintptr, signal bool) {
                }
        }
        g0.stackguard0 = g0.stack.lo + stackGuard
-       g0.stackguard1 = g0.stackguard0
 }
 
 // Call from C back to Go. fn must point to an ABIInternal Go entry-point.
index 34f66d4ada0cf6ed050374d12a96a34fc735beb2..8809b5d569c787924f06e75190e61b3506caee2a 100644 (file)
@@ -423,7 +423,7 @@ type g struct {
        // stack describes the actual stack memory: [stack.lo, stack.hi).
        // stackguard0 is the stack pointer compared in the Go stack growth prologue.
        // It is stack.lo+StackGuard normally, but can be StackPreempt to trigger a preemption.
-       // stackguard1 is the stack pointer compared in the //go:systemstack stack growth prologue.
+       // stackguard1 is the stack pointer compared in the C stack growth prologue.
        // It is stack.lo+StackGuard on g0 and gsignal stacks.
        // It is ~0 on other goroutine stacks, to trigger a call to morestackc (and crash).
        stack       stack   // offset known to runtime/cgo