-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: multi-arch build via qemu fails to exec go binary #68976
Comments
I got the error when build arm64 image in amd host machine with buildx docker buildx create --use --name=baker --driver docker-container --platform=linux/amd64 --platform=linux/arm64
docker buildx build --builder baker --platform=linux/amd64 --platform=linux/arm64 -t {tag} --push . then I tried to run manually with after unzip the command, I got the same error Dockerfile example: FROM almalinux:9.4-20240530
ENV GOROOT=/usr/local/go \
GOLANG_VERSION=1.23.0 \
GOPATH=/go
ENV PATH=$GOPATH/bin:$PATH:$GOROOT/bin
RUN set -eox pipefail \
&& dnf install -y curl \
&& mkdir -p "${GOROOT}" "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" \
&& curl -sSL "https://go.dev/dl/go${GOLANG_VERSION}.linux-$(cat < /etc/arch).tar.gz" | tar -zxvC ${GOROOT} --strip-components=1 \
# && chmod a+x ${GOROOT}/bin/* \
&& go version
WORKDIR $GOPATH |
With the circleci dockerfile, I get a segfault in gcc cc1 rather than something in go directly:
|
Might this have something to do with apparmor or other host "controls"? I was able to run the multiarch build on an Ubuntu 22.04 host using Docker 24.0.7 (from Ubuntu's packages) without errors, and inside the resulting arm64 container was able to run without errors:
|
Could you run the failing command under |
cc @golang/telemetry |
CC @matloob Independent of the root cause, a failure to start the telemetry child process shouldn't prevent the go command from being used. |
Not sure if this is helpful, but I'm attaching two |
Moved to Go1.24 milestone since this need to be fixed on the main branch first (for Go 1.24), before being considered for backporting. Please use the usual process (https://go.dev/wiki/MinorReleases) to create a separate backport tracking issue in the Go1.23.1 milestone. @findleyr It's important that issues in the minor milestones are the backport kind with a CherryPickCandidate label, otherwise we might miss them in our release meeting review. Thanks. |
Thanks again @dmitshur. @gopherbot please backport this issue to 1.23: it is a regression that breaks the go command in certain environments. |
Backport issue(s) opened: #68995 (for 1.23). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Change https://go.dev/cl/607595 mentions this issue: |
…ng/go#68976). We'll disable bugged `linux/arm64` and `linux/arm` Docker image builds for now to avoid the failure, and re-enable it after Golang team fixed the problem.
Instead of calling log.Fatal if the child could not be started, call log.Print. Various factors in the user's environment could cause the child to not be able to start, but that shouldn't crash the parent process (usually the go command). Change other fatals into prints with early returns when attempting to start the child. Reset the crash output file to clean up if the child process could not be started and crashmonitoring is enabled. Updates golang/go#68976 Change-Id: I42f55dc90f68f91b272a7ebf64d2a4a3b00815c7 Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/607595 Commit-Queue: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com>
Change https://go.dev/cl/609195 mentions this issue: |
Change https://go.dev/cl/609196 mentions this issue: |
Change https://go.dev/cl/609256 mentions this issue: |
Ah, sorry for the misunderstanding. |
For comparison, here's a fully stock build (ie, NOT cherry-picking those two CLs) of 00c48ad (again, current $ /usr/local/go/bin/linux_arm64/go version
can't start telemetry child process: fork/exec /usr/local/go/bin/linux_arm64/go: invalid argument
go version devel go1.24-00c48ad Thu Aug 29 18:03:48 2024 +0000 linux/arm64 So the telemetry doesn't make $ /usr/local/go/bin/linux_arm64/go install golang.org/x/vuln/cmd/govulncheck@latest
go: downloading golang.org/x/vuln v1.1.3
go: downloading golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7
go: downloading golang.org/x/mod v0.19.0
go: downloading golang.org/x/tools v0.23.0
go: downloading golang.org/x/sync v0.7.0
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument
go: error obtaining buildID for go tool compile: fork/exec /usr/local/go/pkg/tool/linux_arm64/compile: invalid argument |
Yeah, I didn't think closely enough about this initially. I thought the code starting the telemetry subprocess was doing something special, but the real bug here is that any |
Update x/telemetry to pick up the fixes for golang/go#68976 and golang/go#68946. Commands run (from the gopls module): go get golang.org/x/telemetry@f29ab53 go mod tidy -compat=1.19 For golang/go#68916 Change-Id: Ifbe16ece970a89336f3e372ddfde088cf0770eac Reviewed-on: https://go-review.googlesource.com/c/tools/+/609195 Auto-Submit: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Hi everyone! Have the same issue. Is there any possibility to switch of the telemetry fork process for a while? |
Turning off telemetry doesn't fix it -- it's literally |
is it possible to use lower version of golang to avoid this error? |
This is a 1.23 / dev 1.24 bug. Yes, if one is running into this (as I did), they could consider downgrading to 1.22 until 1.23/dev 1.24 is fixed. |
FWIW, Debian bookworm has QEMU 7.2 in its repository, which is probably why so many people have hit this. To reproduce this issue:
Without https://go.dev/cl/592078:
With https://go.dev/cl/592078:
|
Having similar issue here https://github.com/stakwork/sphinx-tribes/actions/runs/10724756996/job/29741116565 will update if we find a work around
|
We're also having this issue with Go 1.23.1, using a Bookworm-based image. This includes both the |
Same here. Building on Debian Host, but the images was a Alpine based one.
|
@alicethorne-ab I'd like to confirm: are you seeing a fatal |
I have the same problem. I can see the error Unfortunately, now I see the same error @the-hotmann is referring to when I try to use
Here is the output of
To reproduce:
EDIT: missing |
@prattmic , looks like that patch has a conflict? Any idea if this will make it into go v1.23.2? BTW, I tried updating qemu to a newer version on the Debian 12 image but that didn't seem to work either. |
It will likely be in 1.23.2. What is the newer version of QEMU that did not work? |
Change https://go.dev/cl/612218 mentions this issue: |
@prattmic , I tried this: # Debian 12 with go 1.23.1
FROM golang:1.23.1
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && \
go install github.com/securego/gosec/v2/cmd/gosec@latest && \
go install golang.org/x/vuln/cmd/govulncheck@latest The pipeline step with build-golang:
stage: build
image: docker:latest
services:
- name: docker:dind
script:
- docker run --privileged --rm tonistiigi/binfmt:qemu-v8.1.5 --install all
- docker context create multiarch-build
- docker buildx create multiarch-build --name multiarch --driver docker-container --bootstrap --use
- docker buildx build --push --platform linux/amd64,linux/arm64 -f Dockerfile.golang -t some-tag . And I get this error during the mutl-arch build:
|
Go version
go version 1.23.0 linux/arm64
Output of
go env
in your module/workspace:I'm unable to provide the output of `go env` as it fails with the same telemetry fork/exec error.
What did you do?
Our automated image build process fails to perform any step that invokes the
go
binary with the following error:The Dockerfile is here, and is being built via a script that invokes
docker buildx
with multiple platforms, like:It seems that there is something inherent in the qemu arm64 environment that renders
go
unable to fork itself to complete the telemetry setup. I'm fairly confident it's something specific to the 1.23 release as 1.22.6 builds successfully using the same setup today.What did you see happen?
Failures to invoke any
go
commandWhat did you expect to see?
A successful install and configuration of go 1.23.0 in a multi-arch docker build.
The text was updated successfully, but these errors were encountered: