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

cmd/go: go mod download segfault on linux/arm within QEMU on WSL2 #53348

Closed
ProLoDs opened this issue Jun 13, 2022 · 6 comments
Closed

cmd/go: go mod download segfault on linux/arm within QEMU on WSL2 #53348

ProLoDs opened this issue Jun 13, 2022 · 6 comments

Comments

@ProLoDs
Copy link

ProLoDs commented Jun 13, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18.1 linux/arm

Does this issue reproduce with the latest release?

Run go mod download in Ubuntu22.04 with qemu 7.0 (http://ftp.de.debian.org/debian/pool/main/q/qemu/qemu-user-static_7.0+dfsg-7_amd64.deb) and get a segfault:

root@f683ddd33818:/build# go mod download
qemu: Unsupported syscall: 403
qemu: Unsupported syscall: 397
qemu: Unsupported syscall: 397
qemu: Unsupported syscall: 398
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
qemu: Unsupported syscall: 403
qemu: Unsupported syscall: 403

Note: This is was done in a Windows Docker environment with the WSL2 Kernel for docker. In a virtual machine running qemu, the go install ... crashes afterwards.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.18"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.18/pkg/tool/linux_arm"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOARM="6"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/build/go.mod"
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 -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build914925232=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Just execute go mod download.

What did you expect to see?

Go mod download to download the packages

What did you see instead?

go mod download segfaulted.

@mvdan
Copy link
Member

mvdan commented Jun 13, 2022

Please try with Go 1.18.3 first - your version is somewhat out of date and there have been numerous fixes since then.

@mvdan mvdan added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 13, 2022
@ProLoDs
Copy link
Author

ProLoDs commented Jun 13, 2022

Same error:

root@0cfd94a25424:/build# /usr/local/go/bin/go mod download
qemu: Unsupported syscall: 403
qemu: Unsupported syscall: 397
qemu: Unsupported syscall: 397
qemu: Unsupported syscall: 397
qemu: Unsupported syscall: 398
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
qemu: Unsupported syscall: 403
root@0cfd94a25424:/build# /usr/local/go/bin/go version
qemu: Unsupported syscall: 403
qemu: Unsupported syscall: 397
qemu: Unsupported syscall: 397
qemu: Unsupported syscall: 397
qemu: Unsupported syscall: 398
go version go1.18.3 linux/arm
qemu: Unsupported syscall: 403

@seankhliao
Copy link
Member

seankhliao commented Jun 13, 2022

Are you running go inside user mode qemu inside a docker container on windows with a WSL2 backend?
Note user mode qemu isn't a supported platform

@mvdan mvdan removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 13, 2022
@ProLoDs
Copy link
Author

ProLoDs commented Jun 13, 2022

Yes i'm running go inside a user mode qemu inside a docker with WSL2 backend.

@mvdan
Copy link
Member

mvdan commented Jun 13, 2022

#1508 tracks actually supporting and testing user-mode qemu. Fixing that bug by adding a builder and making all tests pass would surely need to fix this problem as well, so I'm not sure that keeping more issues open is necessary. That issue already functions as an umbrella to track user-mode qemu support.

@bcmills bcmills changed the title affected/package: go mod download segfault on arm with with 1.18 cmd/go: go mod download segfault on linux/arm within QEMU on WSL2 Jun 14, 2022
@bcmills bcmills added the GoCommand cmd/go label Jun 14, 2022
@bcmills
Copy link
Member

bcmills commented Jun 14, 2022

Given the Unsupported syscall messages, this looks to me like a QEMU bug that happens to be triggered by running a Go program.

I suggest escalating it to the QEMU maintainers. I agree that there isn't anything we can plausibly do on the Go side without a fix (and active maintainer) for #1508.

@bcmills bcmills closed this as completed Jun 14, 2022
@golang golang locked and limited conversation to collaborators Jun 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants