setup-qemu-action: `tonistiigi/binfmt:latest` (qemu 9.2.0) segfault on ubuntu-24.04 / ubuntu-latest

Contributing guidelines

I’ve found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

As mentioned in https://github.com/docker/setup-qemu-action/issues/188, the default image is unusable on ubuntu-24.04 since a kernel update a few weeks back.

As reported in that issue, moving to the qemu 8.1.5 image solved the issue for most users (since then, there has been a 9.2.0 / master image published).

It seems more & more unlikely that the latest image will be updated and more likely that setup-qemu-action should change the default image (possibly depending on the runner) to an image that works in most cases rather than what I imagine is almost none => hence this is a bug report setup-qemu-action can do something about without closing saying it’s an upstream issue.

Multiple reproducers/logs/… are already available in that issue so not added new ones here.

Expected behaviour

No random segmentation faults.

Actual behaviour

Random segmentation faults in all the repositories I know of when the action is used with the default image on ubuntu-24.04 (latest)

Repository URL

No response

Workflow run URL

No response

YAML workflow

N/C

Workflow logs

No response

BuildKit logs


Additional info

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 29
  • Comments: 19 (2 by maintainers)

Commits related to this issue

Most upvoted comments

We are mysteriously encountering this issue on ARM64 self-hosted GitHub Actions (ghcr.io/actions/actions-runner:2.322.0) based runners, beginning sometime over the past 72 hours, targeting AMD64. None of the workarounds have worked for us. Anyone else in the same boat?

Part of the challenge is that setup-qemu-action is pointing to :latest tag by default. I’d suggest switching to a more specific tag for every release. One, that was used to test this specific release. Immutable Github actions will fix this problem long term, but relying on :latest is wrong and must be fixed.

Same issue

A workaround that we found is to run our docker builds on ARM based VMs with Qemu emulating the AMD64.

Minimal modification was needed for our use case (CI runners). Hope this will help someone 😃

I mentioned it in another issue (here) but I found another workaround as well. If you set up your Dockerfile as a multi-stage build with multiarch/qemu-user-static as a base and inject the QEMU binaries into your target image, no segfaults will generate. Here’s an example:

# Use multiarch/qemu-user-static only for non-native architectures. Ending tag is excluded due to specifying platform
# See https://docs.docker.com/reference/dockerfile/#automatic-platform-args-in-the-global-scope for more info
FROM --platform=$BUILDPLATFORM multiarch/qemu-user-static AS qemu

# Start with base image
FROM luxonis/depthai-library:latest

# Copy QEMU binary only when cross-compiling with ARM and ARM64
COPY --from=qemu /usr/bin/qemu-*-static /usr/bin/

# More build statements...

This was tested on Windows 10 Pro x64 host machine while building docker images to be used on Raspberry Pi 3s (linux/arm/v7) and 4s (linux/arm64/v8). To be clear, only the linux/arm64/v8 builds were failing.

I’d like to know why this works, as this seems too simple for my liking but I’m glad this is a decent workaround for now.