]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: correct mips64 asmcgocall signal stack behaviour
authorJoel Sing <joel@sing.id.au>
Fri, 28 May 2021 18:06:56 +0000 (04:06 +1000)
committerJoel Sing <joel@sing.id.au>
Mon, 16 Aug 2021 07:44:47 +0000 (07:44 +0000)
Do not switch to the g0 stack if we're already running on the signal
stack, otherwise all kind of fun ensues.

Updates #36435

Change-Id: I57f35d75b9ee4f92b997713b4cdd38ce881705e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/334880
Trust: Joel Sing <joel@sing.id.au>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/asm_mips64x.s

index b2e2384c3681f28bbc37e51bc46ed79066ebe280..940a38a0d6fcfac2e020207c16f4be0075ed90a5 100644 (file)
@@ -426,6 +426,8 @@ TEXT Â·asmcgocall(SB),NOSPLIT,$0-20
        // We get called to create new OS threads too, and those
        // come in on the m->g0 stack already.
        MOVV    g_m(g), R5
+       MOVV    m_gsignal(R5), R6
+       BEQ     R6, g, g0
        MOVV    m_g0(R5), R6
        BEQ     R6, g, g0