Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: "SIGILL: illegal instruction" at arm64 v8.0 and use go routing #70987

Closed
friddle opened this issue Dec 25, 2024 · 5 comments
Closed
Labels
arch-arm64 compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@friddle
Copy link

friddle commented Dec 25, 2024

Go version

go1.23.4

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/gopath/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/gopath/'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/root/go/'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/root/go/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='go1.23.4'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/root/.config/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/root/ops-ctl/ops-ctl-core/go.mod'
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-build1050445395=/tmp/go-build -gno-record-gcc-switches'

other:
Architecture:                    aarch64
CPU op-mode(s):                  64-bit
Byte Order:                      Little Endian
CPU(s):                          12
On-line CPU(s) list:             0-11
Thread(s) per core:              1
Core(s) per socket:              1
Socket(s):                       12
NUMA node(s):                    1
Vendor ID:                       Phytium
Model:                           2
Model name:                      FT-2000+/64
Stepping:                        0x1
CPU max MHz:                     2400.0000
CPU min MHz:                     2400.0000
BogoMIPS:                        100.00
L1d cache:                       768 KiB
L1i cache:                       768 KiB
L2 cache:                        6 MiB
L3 cache:                        384 MiB
NUMA node0 CPU(s):               0-11
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected

What did you do?

CGO_ENABLED=0 go build -ldflags "-X main.Version=${git_tag}_${date_sum} -X main.Sum=${git_commit}" -o ../dist/ops-ctl-core ./main.go
./ops-ctl-core

What did you see happen?

[root@localhost dist]# ./ops-ctl-core 
SIGILL: illegal instruction
PC=0xfffb428e01f4 m=0 sigcode=1
instruction bytes: 0xa 0xfd 0xeb 0x88 0xe8 0x3 0xb 0x2a 0xea 0x3 0x1f 0x32 0x1f 0x1 0xa 0x6b

goroutine 1 gp=0x40000021c0 m=0 mp=0x25a6d80 [running, locked to thread]:
runtime: g 1 gp=0x40000021c0: unknown pc 0xfffb428e01f4
stack: frame={sp:0x4000cf67a0, fp:0x0} stack=[0x4001192000,0x40011a2000)

runtime: g 1 gp=0x40000021c0: unknown pc 0xfffb428e01f4
stack: frame={sp:0x4000cf67a0, fp:0x0} stack=[0x4001192000,0x40011a2000)


goroutine 2 gp=0x4000002700 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /root/go/src/runtime/proc.go:424 +0xc8 fp=0x4000076f90 sp=0x4000076f70 pc=0x834b8
runtime.goparkunlock(...)
        /root/go/src/runtime/proc.go:430
runtime.forcegchelper()
        /root/go/src/runtime/proc.go:337 +0xb8 fp=0x4000076fd0 sp=0x4000076f90 pc=0x4d9e8
runtime.goexit({})
        /root/go/src/runtime/asm_arm64.s:1223 +0x4 fp=0x4000076fd0 sp=0x4000076fd0 pc=0x8b7a4
created by runtime.init.7 in goroutine 1
        /root/go/src/runtime/proc.go:325 +0x24

What did you expect to see?

no error

@Jorropo Jorropo added arch-arm64 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. compiler/runtime Issues related to the Go compiler and/or runtime. labels Dec 25, 2024
@Jorropo
Copy link
Member

Jorropo commented Dec 25, 2024

cc @golang/compiler @golang/arm

@seankhliao seankhliao changed the title "SIGILL: illegal instruction" at arm64 v8.0 and use go routing runtime: "SIGILL: illegal instruction" at arm64 v8.0 and use go routing Dec 25, 2024
@prattmic
Copy link
Member

Your instructions bytes are:

0xa 0xfd 0xeb 0x88

To little endian and binary:

0b10001000 11101011 11111101 00001010

Following the encoding at:

This says this encoding is "unallocated", which would explain the immediate cause of SIGILL (though I may have messed something up here).

PC=0xfffb428e01f4 seems very suspicious here. This doesn't look like a normal userspace address, more like a kernel address, and it is clearly way too far away from the normal PCs in the program like pc=0x834b8.

Can you reproduce this under a debugger to see exactly what is faulting? Perhaps capture /proc/PID/maps as well to see what this PC's mapping is.

@friddle
Copy link
Author

friddle commented Dec 27, 2024

thanks
find problem is caused by https://github.com/google/re2 in Phytium arm cpu. in ARM official cpu is ok.

@friddle
Copy link
Author

friddle commented Dec 27, 2024

i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-arm64 compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants