]> Cypherpunks repositories - gostls13.git/commit
runtime: fix spurious stack overflow detection
authorRuss Cox <rsc@golang.org>
Fri, 19 Feb 2021 10:22:35 +0000 (05:22 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 19 Feb 2021 15:30:52 +0000 (15:30 +0000)
commit49add6ad90c3c6e150266b35ae98067d7b52c021
treed6b1b4680c260456886fc6cc65ee2036009911f5
parentfce2a94d84dd5e39e0d53e60beda22da7b6f55b0
runtime: fix spurious stack overflow detection

The regabi builders are unhappy about badctxt calling throw
calling systemstack calling gosave_systemstack_switch calling
badctxt, all nosplit, repeating. This wouldn't actually happen
since after one systemstack we'd end up on the system stack
and the next one wouldn't call gosave_systemstack_switch at all.

The badctxt call itself is in a very unlikely assertion failure
inside gosave_systemstack_switch.
Keep the assertion check but call runtime.abort instead on failure,
breaking the detected (but not real) cycle.

Change-Id: Iaf5c0fc065783b8c1c6d0f62d848f023a0714b96
Reviewed-on: https://go-review.googlesource.com/c/go/+/294069
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_arm.s
src/runtime/asm_arm64.s
src/runtime/asm_mips64x.s
src/runtime/asm_mipsx.s
src/runtime/asm_ppc64x.s
src/runtime/asm_riscv64.s
src/runtime/asm_s390x.s