qemu: uncaught target signal 11 (Segmentation fault) - core dumped

Host environment

  • Operating system: (Windows 10 21H1, Fedora 34, etc.): ubuntu18.04
  • OS/kernel version: (For POSIX hosts, use uname -a): #127~18.04.1-Ubuntu SMP Wed May 18 15:40:23 UTC 2022
  • Architecture: (x86, ARM, s390x, etc.): x86
  • QEMU flavor: (qemu-system-x86_64, qemu-aarch64, qemu-img, etc.): qemu-system-x86_64
  • QEMU version: (e.g. qemu-system-x86_64 --version): 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.39)
  • QEMU command line:
    ./qemu-system-x86_64 -M q35 -m 4096 -enable-kvm -hda fedora32.qcow2

Emulated/Virtualized environment

  • Operating system: (Windows 10 21H1, Fedora 34, etc.)
  • OS/kernel version: (For POSIX guests, use uname -a.)
  • Architecture: (x86, ARM, s390x, etc.): ARM64

Description of problem

I am trying to build arm64 image on my x86_64 machine using buildx and I have encountered qemu: uncaught target signal 11 (Segmentation fault) - core dumped Error.

Machine Description

     *-cpu
          product: Intel(R) Core(TM) i9-9900 CPU @ 3.10GHz
          vendor: Intel Corp.
          physical id: 1
          bus info: cpu@0
          size: 1376MHz
          capacity: 5GHz
          width: 64 bits

Docker Version details

$ docker version
Client: Docker Engine - Community
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:54:08 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:52:16 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.10
  GitCommit:        8848fdb7c4ae3815afcc990a8a99d663dda1b590
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Steps to reproduce

  1. Create a Dockerfile
FROM python:3.8-slim

ENV PYTHONDONTWRITEBYTECODE=1

# Install packages
RUN apt update
RUN apt-get install -y python3-pip
  1. Run binfmt container
docker run --privileged --rm tonistiigi/binfmt --install all
  1. Setup new builder
$ docker buildx create --name mybuilder
$ docker buildx use mybuilder
$ docker buildx inspect --bootstrap
  1. Build Image
$ docker buildx build --platform linux/amd64,linux/arm64 --push -t user/failure-case .

Error Trace

#7 96.84 Setting up libgd3:arm64 (2.3.0-2) ...
#7 96.85 Setting up python3-pip (20.3.4-4+deb11u1) ...
#7 99.72 Setting up python3.9-dev (3.9.2-1) ...
#7 99.73 Setting up libc-devtools (2.31-13+deb11u3) ...
#7 99.73 Setting up libpython3-dev:arm64 (3.9.2-3) ...
#7 99.74 Setting up python3-dev (3.9.2-3) ...
#7 99.75 Processing triggers for libc-bin (2.31-13+deb11u3) ...
#7 99.79 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#7 99.87 Segmentation fault (core dumped)
#7 99.88 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#7 99.97 Segmentation fault (core dumped)
#7 99.97 dpkg: error processing package libc-bin (--configure):
#7 99.97  installed libc-bin package post-installation script subprocess returned error exit status 139
#7 99.99 Errors were encountered while processing:
#7 99.99  libc-bin
#7 100.1 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
dm_test.Dockerfile:9
--------------------
   7 |     # Install packages
   8 |     RUN apt update
   9 | >>> RUN apt-get install -y python3-pip
  10 |     #Python requirements
  11 |
--------------------
error: failed to solve: process "/bin/sh -c apt-get install -y python3-pip" did not complete successfully: exit code: 100

Feel free to ask for more info. Any help is appreciated.

Additional information