aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_amd64.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-02-19 05:22:35 -0500
committerRuss Cox <rsc@golang.org>2021-02-19 15:30:52 +0000
commit49add6ad90c3c6e150266b35ae98067d7b52c021 (patch)
treed6b1b4680c260456886fc6cc65ee2036009911f5 /src/runtime/asm_amd64.s
parentfce2a94d84dd5e39e0d53e60beda22da7b6f55b0 (diff)
downloadgo-49add6ad90c3c6e150266b35ae98067d7b52c021.tar.gz
go-49add6ad90c3c6e150266b35ae98067d7b52c021.zip
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>
Diffstat (limited to 'src/runtime/asm_amd64.s')
-rw-r--r--src/runtime/asm_amd64.s2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s
index a68dc72ae5..517c5a9d3e 100644
--- a/src/runtime/asm_amd64.s
+++ b/src/runtime/asm_amd64.s
@@ -677,7 +677,7 @@ TEXT gosave_systemstack_switch<>(SB),NOSPLIT,$0
MOVQ (g_sched+gobuf_ctxt)(R14), R9
TESTQ R9, R9
JZ 2(PC)
- CALL runtime·badctxt(SB)
+ CALL runtime·abort(SB)
RET
// func asmcgocall_no_g(fn, arg unsafe.Pointer)