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

🐛 [fiberplane-provider-runtime] FPD crashes on start in Docker on M1 Mac #55

Open
gagbo opened this issue May 15, 2023 · 1 comment

Comments

@gagbo
Copy link
Contributor

gagbo commented May 15, 2023

Wasmer in fiberplane-provider-runtime might need to be bumped to 3

Environment information

Running on M1 mac, either with Docker Desktop or with CoLiMa to drive Docker images.

The issue was found by @actualwitch while trying to setup a "quickstart" docker image on MacOS for FPD.

Note that the issue seems to be the same as wasmerio/wasmer#3461 which got solved and merged in tree for versions >= 3.2.0 wasmerio/wasmer@580baeb

I couldn't find any "release 2" branch in a very quick look, so there might

What happened?

  1. Use a dockerfile in the fpd repo
FROM ubuntu:latest
WORKDIR /app
ENV DEBUG=true
RUN apt-get update && apt-get install -y curl unzip
RUN curl --proto '=https' --tlsv1.2 -sSf https://fp.dev/proxy/latest/x86_64-unknown-linux-gnu/proxy.zip -o proxy.zip
RUN unzip proxy.zip
ADD config/data_sources.yaml /root/.config/proxy/data_sources.yaml
ENTRYPOINT ./proxy --token=<Valid Token here>
  1. Build the image for amd64 platform, and run it
docker build --platform=amd64 --rm -t quickstart . 
docker run --platform=linux/amd64 --rm -it -p 127.0.0.1:8080:8080 quickstart
  1. The proxy blows up with an assertion error in the singlepass compiler that seems to be related to register reuse
thread 'thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', <unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:/cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1624:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1624:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1624:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1624:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1624:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1624:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM0`,
 right: `XMM0`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1421:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM0`,
 right: `XMM0`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1421:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM0`,
 right: `XMM0`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1421:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1624:40
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `XMM0`,
 right: `XMM1`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1684:17
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM0`,
 right: `XMM0`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1421:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM0`,
 right: `XMM0`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1421:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM0`,
 right: `XMM0`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1421:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1624:40
thread '<unnamed>' panicked at 'assertion failed: `(left != right)`
  left: `XMM3`,
 right: `XMM3`', /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-singlepass-2.3.0/src/emitter_x64.rs:1463:40
  1. Note that in the container, uname -a returns different results depending on whether the docker image was built with the CoLiMa agent or the Docker Desktop agent, but both fail the same way anyway
# CoLiMa
Linux e615947012e7 5.15.82-0-virt #1-Alpine SMP Mon, 12 Dec 2022 09:15:17 +0000 x86_64 x86_64 x86_64 GNU/Linux
# Docker Desktop
Linux 787a109effc9 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Expected result

It should start without crashing

@arendjr
Copy link
Contributor

arendjr commented May 26, 2023

We do have an issue in fp-bindgen for Wasmer 3 support, but it's not exactly trivial and it needs someone to put in the effort: fiberplane/fp-bindgen#185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants