Skip to content

Segmentation fault in latest binfmt image #240

@zyy17

Description

@zyy17

Minimal Reproduce Steps

  1. Here is the Dockerfile:

    FROM ubuntu:22.04
    
    RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl
    
  2. GitHub Action Job:

   
name: test
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v4

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3
        with:
          platforms: linux/amd64,linux/arm64
          #image: tonistiigi/binfmt:qemu-v7.0.0-28

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: login to registry
        uses: docker/login-action@v3
        with:
          registry: docker.io
          username: xxxx
          password: xxxx

      - name: Build and push image
        uses: docker/build-push-action@v6
        with:
          file: ./Dockerfile
          platforms: linux/amd64,linux/arm64
          push: true
          tags: |
            test:latest
  1. The image building will fail with the following logs:
...
#8 76.59 146 added, 0 removed; done.
#8 76.75 Setting up libcurl4:arm64 (7.81.0-1ubuntu1.20) ...
#8 76.76 Setting up curl (7.81.0-1ubuntu1.20) ...
#8 76.77 Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
#8 76.85 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#8 77.41 Segmentation fault (core dumped)
#8 77.49 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#8 77.96 Segmentation fault (core dumped)
#8 77.97 dpkg: error processing package libc-bin (--configure):
#8 77.97  installed libc-bin package post-installation script subprocess returned error exit status 139
#8 77.97 Processing triggers for ca-certificates (20240203~22.04.1) ...
#8 78.24 Updating certificates in /etc/ssl/certs...
#8 96.93 0 added, 0 removed; done.
#8 96.93 Running hooks in /etc/ca-certificates/update.d...
#8 96.96 done.
#8 97.06 Errors were encountered while processing:
#8 97.06  libc-bin
#8 97.14 E: Sub-process /usr/bin/dpkg returned an error code (1)
#8 ERROR: process "/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl" did not complete successfully: exit code: 100
------
 > [linux/arm64 2/2] RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl:
77.97 dpkg: error processing package libc-bin (--configure):
77.97  installed libc-bin package post-installation script subprocess returned error exit status 139
77.97 Processing triggers for ca-certificates (20240203~22.04.1) ...
78.24 Updating certificates in /etc/ssl/certs...
96.93 0 added, 0 removed; done.
96.93 Running hooks in /etc/ca-certificates/update.d...
96.96 done.
97.06 Errors were encountered while processing:
97.06  libc-bin
97.14 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
./Dockerfile:3
--------------------
   1 |     FROM ubuntu:22.04
   2 |     
   3 | >>> RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl
   4 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl" did not complete successfully: exit code: 100
Reference
  builder-a512d6dc-02fb-482e-ae0e-6148721abea8/builder-a512d6dc-02fb-482e-ae0e-6148721abea80/wx4ps25bomstc0f23cechrmij
Check build summary support
  Build summary supported!
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl" did not complete successfully: exit code: 100
...

How to work around

Use tonistiigi/binfmt:qemu-v7.0.0-28. The current latest tonistiigi/binfmt is qemu-v9.2.0-51. I guess there may have some unstable changes in the latest version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions