-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: Crash in GC on Debian riscv64 (qemu) #54104
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
Comments
It will be fixed after this CL been merged. |
Thanks. I would be thrilled if this could make the 1.19 release train to support my teaching objectives. |
Can this reproduce on a real hardware? For QEMU, I guess it would be possible to configure it to not enable SV57 mode? |
I believe SV57 is enabled in the 5.18 kernel which is distributed with Debian/riscv64. I have looked unsuccessfully for runtime configuration for that feature. If there's a way to change that in QEMU, I don't know what it is. I don't have an Unmatched board, and SiFive discontinued them in favor of a pre-release collaboration with Intel. If it's too late for 1.19, the two possible workarounds I see are:
|
FWIW, I built from |
Most of existed real hardwares (that I can get) using sv39
Qemu configured with |
Hi, vimer@unmatched:~/go/proj/bin$ uname -a
Linux unmatched 5.18.0-2-riscv64 #1 SMP Debian 5.18.5-1 (2022-06-16) riscv64 GNU/Linux
vimer@unmatched:~/go/proj/bin$ go env
GO111MODULE=""
GOARCH="riscv64"
GOBIN=""
GOCACHE="/home/vimer/.cache/go-build"
GOENV="/home/vimer/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="riscv64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/vimer/go/proj/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/vimer/go/proj"
GOPRIVATE=""
GOPROXY="https://proxy.golang.com.cn"
GOROOT="/home/vimer/go/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/vimer/go/go/pkg/tool/linux_riscv64"
GOVCS=""
GOVERSION="go1.18.4"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2096220389=/tmp/go-build -gno-record-gcc-switches"
vimer@unmatched:~/go/proj/bin$ ./micro --version
Version: 2.0.11-dev.100
Commit hash: 225927b9
Compiled on July 29, 2022
vimer@unmatched:~/go/proj/bin$ ip a | ./micro The micro editor runs fine in my view also. |
Change https://go.dev/cl/409055 mentions this issue: |
riscv64 has SV57 mode when user-space VA is 56 bits. Linux kernel recently got support for this mode and Go binaries started crashing as: runtime: lfstack.push invalid packing: node=0xffffff5908a940 cnt=0x1 packed=0xffff5908a9400001 -> node=0xffff5908a940 Adjust lfstack code to use only 8 top bits of pointers on riscv64. For context see: https://groups.google.com/g/syzkaller-bugs/c/lU0GQTZoNQQ/m/O_c3vmE3AAAJ Update #54104 Change-Id: Ib5d3d6a79c0c6eddf11618d73fcc8bc1832a9c25 Reviewed-on: https://go-review.googlesource.com/c/go/+/409055 Reviewed-by: Joel Sing <[email protected]> Reviewed-by: Meng Zhuo <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
riscv64 has SV57 mode when user-space VA is 56 bits. Linux kernel recently got support for this mode and Go binaries started crashing as: runtime: lfstack.push invalid packing: node=0xffffff5908a940 cnt=0x1 packed=0xffff5908a9400001 -> node=0xffff5908a940 Adjust lfstack code to use only 8 top bits of pointers on riscv64. For context see: https://groups.google.com/g/syzkaller-bugs/c/lU0GQTZoNQQ/m/O_c3vmE3AAAJ Update golang#54104 Change-Id: Ib5d3d6a79c0c6eddf11618d73fcc8bc1832a9c25 Reviewed-on: https://go-review.googlesource.com/c/go/+/409055 Reviewed-by: Joel Sing <[email protected]> Reviewed-by: Meng Zhuo <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
This should be fixed via https://go.dev/cl/409055, closing. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?I am cross-compiling the micro editor on my Mac targeting a Debian riscv64 guest under QEMU. The Debian guest is
Linux debian 5.18.0-2-riscv64 https://github.com/zyedidia/micro/issues/1 SMP Debian 5.18.5-1 (2022-06-16) riscv64 GNU/Linux
go env
OutputWhat did you do?
GOOS=linux GOARCH=riscv64 CGO_ENABLED=0 make build
.micro
and Iscp
that to the Debian guestWhat did you expect to see?
I expect to run the micro editor
What did you see instead?
The micro editor crashes on launch with the output below, apparently showing a crash in the Go GC. I opened an issue in the micro repo, but the author suggests that the root cause is inside Go.
Interestingly, the same
micro
binary runs on an Ubuntu guestLinux ubuntu 5.13.0-1026-generic #29~20.04.1-Ubuntu SMP Fri Jun 3 11:55:52 UTC 2022 riscv64 riscv64 riscv64 GNU/Linux
but crashes on launch on the Debian guest.stack trace
stack traceThe text was updated successfully, but these errors were encountered: