Repository: go
Issue: runtime: endless sigtramp in the stack of coredump generated by panic on arm64
Labels: NeedsInvestigation,arch-arm64,compiler/runtime

<!--
Please answer these questions before submitting your issue. Thanks!
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.20.2 linux/arm64
</pre>

### Does this issue reproduce with the latest release?

yes

### What operating system and processor architecture are you using (`go env`)?
CentOS Linux release 7.9.2009 (AltArch) (qemu on apple m2 host)

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/home/gpadmin/.cache/go-build"
GOENV="/home/gpadmin/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/gpadmin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/gpadmin/go"
GOPRIVATE=""
GOPROXY="https://goproxy.io"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2696082919=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on go.dev/play is best.
-->

test:
```
package main

import (
"fmt"
"runtime/debug"
)

func main() {
	debug.SetTraceback("crash")
	fmt.Println("xxx")
	panic("xxx")
}
```

then build it, run it, and check the coredump with dlv:

```
go build test.go
./test
dlv core ./test /tmp/core-test-6-1000-1000-4693-1678678851
```


### What did you expect to see?

normal stack

### What did you see instead?

endless runtime.sigtramp, for example:
```
dlv core ./test /tmp/core-test-6-1000-1000-4693-1678678851

 0  0x000000000006c298 in runtime.raise
    at /usr/local/go/src/runtime/sys_linux_arm64.s:158
 1  0x0000000000054094 in runtime.dieFromSignal
    at /usr/local/go/src/runtime/signal_unix.go:879
 2  0x0000000000054598 in runtime.sigfwdgo
    at /usr/local/go/src/runtime/signal_unix.go:1092
 3  0x00000000000530ac in runtime.sigtrampgo
    at /usr/local/go/src/runtime/signal_unix.go:432
 4  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
 5  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
 6  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
 7  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
 8  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
 9  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
10  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
11  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
12  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
13  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
14  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
15  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
16  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
17  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
18  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
19  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
20  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
21  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
22  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
23  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
24  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
25  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
26  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
27  0x000000000006c644 in runtime.sigtramp
    at /usr/local/go/src/runtime/sys_linux_arm64.s:467
```