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

ARM Compiler Panic due to ImpossibleRelocation error (aka. Upgrade to Wasmer 4.3) #1628

Closed
sashaduke opened this issue Mar 10, 2023 · 7 comments · Fixed by #2147
Closed

ARM Compiler Panic due to ImpossibleRelocation error (aka. Upgrade to Wasmer 4.3) #1628

sashaduke opened this issue Mar 10, 2023 · 7 comments · Fixed by #2147
Milestone

Comments

@sashaduke
Copy link

sashaduke commented Mar 10, 2023

Hi there,

I have a zk-STARK verifier contract which works correctly on x86 systems, but when I try upload it to a CW chain on my arm/aarch machine (M1 Macbook Pro), the compiler panics during the upload/store tx and gives the following error:
thread '<unnamed>' panicked at 'called Result::unwrap() on an Err value: ImpossibleRelocation(Dynamic(DynamicLabel(0)))', /usr/local/cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/wasmer-compiler-singlepass-2.2.1/src/machine_arm64.rs:1971:35

You can find the contract source here in order to recreate the bug (you may need to increase the MaxWasmSize in x/wasm/types/validation.go): https://github.com/sashaduke/cw-miden-verifier/tree/main/contracts/verifier

Kind regards

@webmaster128
Copy link
Member

Heyhey! Thanks a lot for this report. I found the same thing today in a different contract – what a coincidence!

Panick wasmer ARM

I think it's safe to say that the ARM build of CosmWasm is not safe to use in consensus critical systems.

I'd not debug this before upgrading to Wasmer 3.x to avoid wasting resources. For now I recommend using an x86 build of the chain and run it in Docker on ARM machines.

@sashaduke
Copy link
Author

Haha what a coincidence indeed! No worries, I can do with running on x86 or emulating for now :)
Thanks!

@webmaster128
Copy link
Member

Most likely this was just fixed in Wasmer (unreleased). wasmerio/wasmer#4519

@webmaster128
Copy link
Member

Wasmer upgrade expected this week. Once it is there, we can upgrade and fix this.

@webmaster128 webmaster128 added this to the 2.1.0 milestone Apr 15, 2024
@syrusakbary
Copy link

Hey @sashaduke , we just fixed the main issue in Wasmer which likely fixes this issue.
To verify this, it would great if you could attach the wasm file inside the original issue wasmerio/wasmer#4519, thanks!

@chipshort
Copy link
Collaborator

Good news! I tested the contract with the new wasmer 4.3.0-alpha.1 release and it fixes the problem.

@webmaster128 webmaster128 changed the title ARM Compiler Panic due to ImpossibleRelocation error ARM Compiler Panic due to ImpossibleRelocation error (aka. Upgrade to Wasmer 4.3) May 7, 2024
@webmaster128
Copy link
Member

4.3.0 is ready now. We can use it and close this ticket.

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

Successfully merging a pull request may close this issue.

4 participants