-
Notifications
You must be signed in to change notification settings - Fork 509
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
libc-bin segfaults ( script subprocess returned error exit status 139 ) ( qemu: uncaught target signal 11 (Segmentation fault) - core dumped ) #314
Comments
I am having this exact problem as well, and would very much appreciate any insight/workaround/solution? |
I was using Debian |
Same issue here. |
Definitely related: moby/qemu#19 |
I'm having a similar behavior while building multi-arch images on an ARM64 workstation (16 cores, 32GB RAM). My Dockerfile: # Build with:
# docker buildx build -t carlosedp/eventrouter:latest --platform linux/amd64,linux/arm,linux/arm64,linux/arm,linux/ppc64le -f Dockerfile-eventrouter --push .
#
FROM golang:1.16 as builder
RUN mkdir -p /go/src/github.com/openshift && \
cd /go/src/github.com/openshift && \
git clone https://github.com/openshift/eventrouter
RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .
FROM alpine:3.14 as run
WORKDIR /app
RUN apk update --no-cache && apk add ca-certificates
COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter
USER nobody:nobody
CMD ["/bin/sh", "-c", "/app/eventrouter -v 3 -logtostderr"] The run and error: ❯ docker buildx build -t carlosedp/eventrouter:latest --platform linux/amd64,linux/arm,linux/arm64,linux/arm,linux/ppc64le -f Dockerfile-eventrouter --push .
[+] Building 108.5s (36/38)
=> [internal] load build definition from Dockerfile-eventrouter 0.0s
=> => transferring dockerfile: 735B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [linux/ppc64le internal] load metadata for docker.io/library/alpine:3.14 1.7s
=> [linux/ppc64le internal] load metadata for docker.io/library/golang:1.16 1.7s
=> [linux/arm/v7 internal] load metadata for docker.io/library/alpine:3.14 1.6s
=> [linux/arm/v7 internal] load metadata for docker.io/library/golang:1.16 1.5s
=> [linux/arm64 internal] load metadata for docker.io/library/alpine:3.14 1.6s
=> [linux/arm64 internal] load metadata for docker.io/library/golang:1.16 1.6s
=> [linux/amd64 internal] load metadata for docker.io/library/alpine:3.14 1.5s
=> [linux/amd64 internal] load metadata for docker.io/library/golang:1.16 1.5s
=> [linux/arm/v7 run 1/4] FROM docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae 0.1s
=> => resolve docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae 0.1s
=> [linux/arm/v7 builder 1/3] FROM docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f 0.1s
=> => resolve docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f 0.1s
=> [linux/amd64 run 1/4] FROM docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae 0.0s
=> => resolve docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae 0.0s
=> [linux/amd64 builder 1/3] FROM docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f 0.1s
=> => resolve docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f 0.1s
=> [linux/ppc64le builder 1/3] FROM docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f 0.1s
=> => resolve docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f 0.1s
=> [linux/ppc64le run 1/4] FROM docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae 0.1s
=> => resolve docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae 0.0s
=> [linux/arm64 builder 1/3] FROM docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f 0.1s
=> => resolve docker.io/library/golang:1.16@sha256:3c4de86eec9cbc619cdd72424abd88326ffcf5d813a8338a7743c55e5898734f 0.0s
=> [linux/arm64 run 1/4] FROM docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae 0.1s
=> => resolve docker.io/library/alpine:3.14@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae 0.0s
=> CACHED [linux/amd64 run 2/4] WORKDIR /app 0.0s
=> CACHED [linux/amd64 run 3/4] RUN apk update --no-cache && apk add ca-certificates 0.0s
=> CACHED [linux/arm/v7 run 2/4] WORKDIR /app 0.0s
=> CACHED [linux/arm/v7 run 3/4] RUN apk update --no-cache && apk add ca-certificates 0.0s
=> CACHED [linux/arm/v7 builder 2/3] RUN mkdir -p /go/src/github.com/openshift && cd /go/src/github.com/openshift && git clone https://github.com/openshift/eventrouter 0.0s
=> [linux/arm/v7 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build . 84.1s
=> CACHED [linux/amd64 builder 2/3] RUN mkdir -p /go/src/github.com/openshift && cd /go/src/github.com/openshift && git clone https://github.com/openshift/eventrouter 0.0s
=> ERROR [linux/amd64 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build . 106.5s
=> CACHED [linux/ppc64le builder 2/3] RUN mkdir -p /go/src/github.com/openshift && cd /go/src/github.com/openshift && git clone https://github.com/openshift/eventrouter 0.0s
=> CACHED [linux/ppc64le run 2/4] WORKDIR /app 0.0s
=> CACHED [linux/ppc64le run 3/4] RUN apk update --no-cache && apk add ca-certificates 0.0s
=> CANCELED [linux/ppc64le builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build . 106.6s
=> CACHED [linux/arm64 builder 2/3] RUN mkdir -p /go/src/github.com/openshift && cd /go/src/github.com/openshift && git clone https://github.com/openshift/eventrouter 0.0s
=> [linux/arm64 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build . 70.8s
=> CACHED [linux/arm64 run 2/4] WORKDIR /app 0.0s
=> CACHED [linux/arm64 run 3/4] RUN apk update --no-cache && apk add ca-certificates 0.0s
=> [linux/arm64 run 4/4] COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter 0.1s
=> [linux/arm/v7 run 4/4] COPY --from=builder /go/src/github.com/openshift/eventrouter/eventrouter /app/eventrouter 0.2s
------
> [linux/amd64 builder 3/3] RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .:
#23 16.97 # net
#23 16.97 SIGSEGV: segmentation violation
#23 16.97 PC=0x0 m=5 sigcode=0
#23 16.97
#23 16.97 goroutine 46 [running]:
#23 16.97 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 34.39 # github.com/gogo/protobuf/proto
#23 34.39 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 39.07 # k8s.io/apimachinery/third_party/forked/golang/reflect
#23 39.07 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 39.52 # github.com/hashicorp/hcl/hcl/scanner
#23 39.52 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 60.23 # k8s.io/apimachinery/pkg/util/clock
#23 60.23 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#23 93.41 # github.com/prometheus/client_golang/prometheus/internal
#23 93.41 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
------
Dockerfile-eventrouter:10
--------------------
8 | git clone https://github.com/openshift/eventrouter
9 |
10 | >>> RUN cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build .
11 |
12 | FROM alpine:3.14 as run
--------------------
error: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c cd /go/src/github.com/openshift/eventrouter && CGO_ENABLED=0 go build ." did not complete successfully: exit code: 2 I believe cross-building from ARM64 to AMD64 and ppc64le are not supported since |
@carlosedp IIRC buildkit official image qemu bundled version is outdated. |
I've installed latest Qemu on the Ubuntu 20.04 host.. it's 5.2.0 and checked that the emulator is using Qemu 6.0:
Also I've registered all binfmt and used a cpu=max image from @tonistiigi: docker run --privileged --rm tonistiigi/binfmt --install all
docker run -it --rm --privileged tonistiigi/binfmt --uninstall qemu-x86_64
docker run -it --rm --privileged tonistiigi/binfmt:qemu-v5.0.1-cpu-max --install amd64 I'm still seeing segfaults for both PPC64le and AMD64 cross-builds. Ref. |
qemu 5 simply did not work for me, and has been segfaulting a lot (specifically what is described in this ticket). You might want to just uninstall qemu on the host entirely (I do not think you need it), then use Tonis binfmt image (or equivalent) to get just user qemu6 in. Wishing you luck, this is a rabbit hole :) |
Can you try with the latest release (qemu 6.1.0)?: $ docker pull tonistiigi/binfmt:latest
$ docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
$ docker run --privileged --rm tonistiigi/binfmt --install all We have also published a new image with qemu 6.2.0 (not latest atm) $ docker pull tonistiigi/binfmt:qemu-v6.2.0 If it's still happening can you open a new issue with a complete repro so we can test on our side please? Thanks. |
Re-creating the buildx instance and registering with Qemu (6.1) worked fine:
Thanks! |
should be possible again, as docker/buildx#314 seems to be fixed
@crazy-max Worked for me on |
This fix my problem 👍 :+1 if this working for you. |
I hit this issue with GCP Cloud Build when installing ImageMagick in our Upgrading from
|
Multi-image builds segfault with the famous:
installed libc-bin package post-installation script subprocess returned error exit status 139
, adding||true
in dockerfile does not help , since dpkg does not even extract new packagesCountermeasures tried:
rm /var/cache/ldconfig/aux-cache 2>/dev/null|| true ;/sbin/ldconfig || true
apt-get -y --reinstall install libc-bin
/etc/gai.conf
options single-request timeout:2 attempts:2 ndots:2" /etc/resolv.conf || (echo "options single-request timeout:2 attempts:2 ndots:2" >> /etc/resolv.conf )
Nothing helps (!)
Build command line:
time docker buildx build --progress plain --network=host --memory-swap -1 --memory 1024 --platform=linux/amd64 --network=host --memory-swap -1 --memory 1024 -f Dockerfile .
Example Dockerfile (testing , the real ones are a bit more complex ;) )
Example Log:
What to do ?
The text was updated successfully, but these errors were encountered: