Closed phpeterson-usf closed 2 years ago
It will be fixed after this CL been merged. https://go-review.googlesource.com/c/go/+/409055
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 go1.19rc2
+ Ian's change (e9f157e.diff
) and cross-compiled micro
to avoid bootstrapping Go on riscv64. The resulting micro
binary seems to work fine on my Debian/riscv64 guest.
Can this reproduce on a real hardware?
For QEMU, I guess it would be possible to configure it to not enable SV57 mode?
Most of existed real hardwares (that I can get) using sv39
Qemu configured with -cpu=sifive-u54
to disable SV57.
Hi, I just have Unmatched boards by hand and I tested it easily:
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. Please let me know if there are any issues.
Change https://go.dev/cl/409055 mentions this issue: runtime: support riscv64 SV57 mode
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 trace