Skip to content

Commit c0c4a59

Browse files
prattmicgopherbot
authored andcommitted
Revert "runtime: set stackguard1 on extra M g0"
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 <[email protected]> Auto-Submit: Michael Pratt <[email protected]> Reviewed-by: Bryan Mills <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 298e848 commit c0c4a59

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/runtime/cgocall.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ func callbackUpdateSystemStack(mp *m, sp uintptr, signal bool) {
233233
g0.stack.hi = sp + 1024
234234
g0.stack.lo = sp - 32*1024
235235
g0.stackguard0 = g0.stack.lo + stackGuard
236-
g0.stackguard1 = g0.stackguard0
237236

238237
print("M ", mp.id, " procid ", mp.procid, " runtime: cgocallback with sp=", hex(sp), " out of bounds [", hex(lo), ", ", hex(hi), "]")
239238
print("\n")
@@ -272,7 +271,6 @@ func callbackUpdateSystemStack(mp *m, sp uintptr, signal bool) {
272271
}
273272
}
274273
g0.stackguard0 = g0.stack.lo + stackGuard
275-
g0.stackguard1 = g0.stackguard0
276274
}
277275

278276
// Call from C back to Go. fn must point to an ABIInternal Go entry-point.

src/runtime/runtime2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ type g struct {
423423
// stack describes the actual stack memory: [stack.lo, stack.hi).
424424
// stackguard0 is the stack pointer compared in the Go stack growth prologue.
425425
// It is stack.lo+StackGuard normally, but can be StackPreempt to trigger a preemption.
426-
// stackguard1 is the stack pointer compared in the //go:systemstack stack growth prologue.
426+
// stackguard1 is the stack pointer compared in the C stack growth prologue.
427427
// It is stack.lo+StackGuard on g0 and gsignal stacks.
428428
// It is ~0 on other goroutine stacks, to trigger a call to morestackc (and crash).
429429
stack stack // offset known to runtime/cgo

0 commit comments

Comments
 (0)