Skip to content
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

Building the container crashes with QEMU + arm64 + Erlang/OTP 25 #3983

Closed
badlop opened this issue Jan 26, 2023 · 0 comments
Closed

Building the container crashes with QEMU + arm64 + Erlang/OTP 25 #3983

badlop opened this issue Jan 26, 2023 · 0 comments
Assignees
Labels
Packaging:Container Container image from GitHub Packages

Comments

@badlop
Copy link
Member

badlop commented Jan 26, 2023

Since ejabberd 17.03, a container image is published in Docker Hub for amd64 architecture.

Since ejabberd 22.05, there is an alternative container image available in GitHub Container Registry. It includes variants for amd64... and arm64 thanks to QEMU. It is built directly from the source code using this Dockerfile. In fact, the image is built automatically for every ejabberd release and every commit using this GitHub Workflow, which uses QEMU to allow building for the arm64 architecture.

Unfortunately, using QEMU + arm64 + Erlang/OTP 25 crashes with segmentation fault. For example, when building the ejabberd container for arm64 using Alpine 3.17, which includes Erlang 25, the action crashes:

#18 [linux/arm64 build  3/10] RUN mix local.hex --force     && mix local.rebar --force
#18 1.302 Segmentation fault (core dumped)
#18 ERROR: process "/bin/sh -c mix local.hex --force     && mix local.rebar --force" did not complete successfully: exit code: 139

The issue is tracked in QEMU's bug tracker: Erlang/OTP 25 JIT on AArch64 fails in user mode emulation

An obvious workaround would be to keep using Alpine 3.16, which includes the safe Erlang/OTP 24 for building those container images, to be able to use QEMU to build the arm64 architecture. This is acceptable now, and upgrade can be delayed hoping that a definitive solution is found in QEMU or Erlang...

But Sando38 has prepared an alternative way to build the container in Github Actions: using the binary installers. In that case, there would be multiple stages in .github/container/Dockerfile, and the METHOD argument would control whether:

  • the container is built using the binary installers for amd64 and arm64 (used by github actions)
  • the container is built compiling ejabberd like now (useful to allow anybody build the container quickly when QEMU is not required)
@badlop badlop changed the title Building the Container crashes with QEMU + arm64 + Erlang/OTP 25 Building the container crashes with QEMU + arm64 + Erlang/OTP 25 Jan 26, 2023
@badlop badlop added the Packaging:Container Container image from GitHub Packages label Jan 26, 2023
badlop added a commit that referenced this issue Jan 26, 2023
Alpine 3.17 includes Erlang/OTP 25, and it segfaults when
used in QEMU for arm64.

Revert "Update Alpine to 3.17 to get Elixir 1.14 required by recent libraries"
This reverts commit 43cae92.
@badlop badlop self-assigned this Jan 26, 2023
badlop pushed a commit that referenced this issue Mar 28, 2023
make-*: include musl build in make-binaries

Ctr actions: use github runners to provide bootstrap erlang

- adjust make-binaries script to use github runners' installed erlang
  for bootstrapping
- this reduces the need to build an unnecessary toolchain for glibc
  based binaries
@badlop badlop added this to the ejabberd 23.xx milestone Mar 28, 2023
@badlop badlop closed this as completed Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packaging:Container Container image from GitHub Packages
Projects
None yet
Development

No branches or pull requests

1 participant