erlef / docker-elixir

Official Docker image for Elixir :whale: :turtle: :rocket:
http://elixir-lang.org/
50 stars 20 forks source link

elixir 1.14 images segfault when running under qemu "Segmentation fault (core dumped)" #61

Closed pgray closed 1 year ago

pgray commented 1 year ago

We use docker buildx to generate linux/arm64 builds over at wasmcloud and have been using the official elixir images for a while.

Today, we discovered our version upgrade (elixir 1.13 -> 1.14) left us using images that seem broken when running on x86_64 under qemu:

# information about my machine/environment
[pgray@ls ~]$ uname -m
x86_64
[pgray@ls ~]$ export DOCKER_DEFAULT_PLATFORM=linux/arm64

debian-slim:

[pgray@ls ~]$ docker run -it --rm --entrypoint bash elixir:1.13-slim
root@881af09409ab:/# mix --version
Erlang/OTP 24 [erts-12.3.2.7] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1]

Mix 1.13.4 (compiled with Erlang/OTP 24)
root@881af09409ab:/# 
exit

[pgray@ls ~]$ docker run -it --rm --entrypoint bash elixir:1.14-slim
root@776e8f141cf5:/# mix --version
Segmentation fault (core dumped)
root@776e8f141cf5:/# 
exit

alpine:


[pgray@ls ~]$ docker run -it --rm --entrypoint sh elixir:1.13-alpine
/ # mix --version
Erlang/OTP 24 [erts-12.3.2.7] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1]

Mix 1.13.4 (compiled with Erlang/OTP 24)
/ # 

[pgray@ls ~]$ docker run -it --rm --entrypoint sh elixir:1.14-alpine
/ # mix --version
Segmentation fault (core dumped)```

I pulled down `hexpm/elixir:1.14.2-erlang-24.3.4.9-debian-bullseye-20230202-slim` to compare and it works without issue.
sando38 commented 1 year ago

Hi @pgray, please try again with elixir vsn 1.14.4, as it seems with the recent update to erlang/otp 25.3 segfaults with qemu vanished. At least for different project I experienced segfaults with erlang/otp 25.0 - 25.2.x.

pgray commented 1 year ago

So it has... that's weird, but thanks for the notification!

brooksmtownsend commented 1 year ago

Hi @sando38 , unfortunately it doesn't seem like using 1.14.4 fully resolved our issue. I was updating one of our related projects and it seems I hit a segfault when running mix deps.get, strangely enough.

Here is that PR, I set up a minimal Dockerfile to reproduce that sources from elixir:1.14.4-slim

sando38 commented 1 year ago

Yeah, I saw that @brooksmtownsend . Maybe there is hope now with closing of this issue: https://gitlab.com/qemu-project/qemu/-/issues/1034

mgwidmann commented 1 year ago

For others that find this issue, the most recent image I can find that works from some basic testing (install hex and rebar locally, install phx_new, generate phoenix project, install dependencies, compile project). Other operating systems may work but it seems 1.14 with erlang 23 are the most recent functional images when running cross-architecture (I have M1 Mac, trying to run X86 images).

https://hub.docker.com/layers/hexpm/elixir/1.14.5-erlang-23.3.4.19-ubuntu-focal-20230126/images/sha256-d039e09bb7a76e248450ccd18335dfdba6f9cf84e50e4e14e7e7f0a842cdc57f?context=explore

pgray commented 1 year ago

awesome news. closing