Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
pranjaldoshi96 opened this issue Jun 16, 2022 · 3 comments
Closed

Comments

@pranjaldoshi96
Copy link

pranjaldoshi96 commented Jun 16, 2022

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

OS: ubuntu:18:04

$ 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,linux/arm/v7 --push -t user/failure-case .

Error Trace

#25 133.4 Setting up libpython3-dev:arm64 (3.9.2-3) ...
#25 133.5 Setting up python3-dev (3.9.2-3) ...
#25 133.5 Processing triggers for libc-bin (2.31-13+deb11u3) ...
#25 133.5 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#25 133.6 Segmentation fault (core dumped)
#25 133.6 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#25 133.8 Segmentation fault (core dumped)
#25 133.8 dpkg: error processing package libc-bin (--configure):
#25 133.8  installed libc-bin package post-installation script subprocess returned error exit status 139
#25 133.8 Errors were encountered while processing:
#25 133.8  libc-bin
#25 133.9 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
Dockerfile:7
--------------------
  12 |
  13 |     RUN apt update
  14 | >>> RUN apt-get install -y python3-pip
  15 |     #Python requirements
  16 |     RUN pip3 install \
--------------------
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.

@crazy-max
Copy link
Member

3. Run binfmt container

docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3

Use

$ docker run --privileged --rm tonistiigi/binfmt --install all

docker/binfmt image is outdated.

@pranjaldoshi96
Copy link
Author

pranjaldoshi96 commented Jun 16, 2022

Using tonistiigi/binfmt didn't made any difference. And I am getting same error
FYI: I tried this on native arm64 machine and it was working flawlessly.

#8 113.3 Setting up libc-devtools (2.31-13+deb11u3) ...
#8 113.3 Setting up libpython3-dev:arm64 (3.9.2-3) ...
#8 113.3 Setting up python3-dev (3.9.2-3) ...
#8 113.3 Processing triggers for libc-bin (2.31-13+deb11u3) ...
#8 113.4 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#8 113.4 Segmentation fault (core dumped)
#8 113.5 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#8 113.5 Segmentation fault (core dumped)
#8 113.5 dpkg: error processing package libc-bin (--configure):
#8 113.5  installed libc-bin package post-installation script subprocess returned error exit status 139
#8 113.6 Errors were encountered while processing:
#8 113.6  libc-bin
#8 113.6 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
dm_test.Dockerfile:14
--------------------
  12 |
  13 |     RUN apt update
  14 | >>> RUN apt-get install -y python3-pip
  15 |     #Python requirements
  16 |     RUN pip3 install \
--------------------
error: failed to solve: process "/bin/sh -c apt-get install -y python3-pip" did not complete successfully: exit code: 100

To add more I thought I might have fetched incorrectly python:3.8-slim so I build image using that and ran it on arm64 and on that machine I ran apt-get install -y python3-pip which worked perfectly fine. So seems like some issue with qemu

@MrXhh
Copy link

MrXhh commented Mar 22, 2024

I had this problem too, and OCF was displayed. However, I still had the segfault until I ran the final command, docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes. Then after that the segfault went away. build success

#1170 (comment)

jwillmartin pushed a commit to usdot-fhwa-OPS/V2X-Hub that referenced this issue Mar 4, 2025
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description
Temporary remove arm builds. Issue is similar to following 
<!--- Describe your changes in detail -->
docker/buildx#1169
docker/buildx#1170
might also be related to 
docker/build-push-action#1309
## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Defect fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
[V2XHUB Contributing
Guide](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants