]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: disable pprof test with cgo on aix/ppc64
authorClément Chigot <clement.chigot@atos.net>
Thu, 21 Feb 2019 09:14:46 +0000 (10:14 +0100)
committerIan Lance Taylor <iant@golang.org>
Tue, 19 Mar 2019 04:18:48 +0000 (04:18 +0000)
This commit disables new cgo pprof tests and adds an handler in sigtramp
to refuse SIGPROF signal.

Updates #28555

Change-Id: I152a871f8636e93328d411329104c6f023bd1691
Reviewed-on: https://go-review.googlesource.com/c/go/+/164013
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/crash_cgo_test.go
src/runtime/pprof/proto_test.go
src/runtime/sys_aix_ppc64.s

index c1dd757797dead6863dd174baae6367dec8a2408..e0c8955e7d83f78ef29525362e890b0853378f4c 100644 (file)
@@ -229,6 +229,9 @@ func TestCgoPanicDeadlock(t *testing.T) {
 }
 
 func TestCgoCCodeSIGPROF(t *testing.T) {
+       if runtime.GOOS == "aix" {
+               t.Skip("pprof not yet available on AIX (see golang.org/issue/28555)")
+       }
        t.Parallel()
        got := runTestProg(t, "testprogcgo", "CgoCCodeSIGPROF")
        want := "OK\n"
index 4452d5123158e5c40af264536d92a21624000ddc..cb38150da8ce045b62fec47053883dbb12487360 100644 (file)
@@ -312,6 +312,10 @@ func TestMapping(t *testing.T) {
        testenv.MustHaveGoRun(t)
        testenv.MustHaveCGO(t)
 
+       if runtime.GOOS == "aix" {
+               t.Skip("pprof not yet available on AIX (see golang.org/issue/28555)")
+       }
+
        prog := "./testdata/mappingtest/main.go"
 
        // GoOnly includes only Go symbols that runtime will symbolize.
index d691b76cc7d7359bb833b559b581f54126cf8775..d9e97ac8b7bb9aaa07d00f64eb0e04accb82ebd6 100644 (file)
@@ -109,6 +109,9 @@ TEXT runtime·_sigtramp(SB),NOSPLIT|NOFRAME,$0
 
        BL      runtime·load_g(SB)
 
+       CMP     $0, g
+       BEQ     sigtrampnog // g == nil
+
        // Save m->libcall. We need to do this because we
        // might get interrupted by a signal in runtime·asmcgocall.
 
@@ -155,6 +158,7 @@ TEXT runtime·_sigtramp(SB),NOSPLIT|NOFRAME,$0
        MOVD    120(R1), R8
        MOVD    R8, 0(R7)
 
+exit:
        // restore registers
        MOVD    56(R1),R31
        MOVD    64(R1),g
@@ -166,6 +170,19 @@ TEXT runtime·_sigtramp(SB),NOSPLIT|NOFRAME,$0
        MOVD    R0, LR
        BR (LR)
 
+sigtrampnog:
+       // Signal arrived on a non-Go thread.
+       // SIGPROF handler is not yet available so simply call badsignal,
+       // after having created *sigctxt.
+       MOVD    R4, 80(R1)
+       MOVD    R5, 88(R1)
+       MOVD    R1, R4
+       ADD             $80, R4
+       MOVD    R4, FIXED_FRAME+8(R1)
+       MOVD    R3, FIXED_FRAME+0(R1)
+       BL runtime·badsignal(SB)
+       JMP     exit
+
 // runtime.tstart is a function descriptor to the real tstart.
 DATA   runtime·tstart+0(SB)/8, $runtime·_tstart(SB)
 DATA   runtime·tstart+8(SB)/8, $TOC(SB)