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

[BUG] (firefox) CompileError: wasm validation error: at offset 10160270: unrecognized opcode: 12 0 #10

Open
JasonGross opened this issue Nov 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JasonGross
Copy link
Contributor

JasonGross commented Nov 23, 2023

Describe the bug

wasm_of_ocaml generates wasm that's only valid in Chrome but fails in Firefox with "unrecognized opcode: 12 0"
Here is the source code: fiat-html.tar.gz
If you unpack the tar.gz, run python -m http.server 8000 in the fiat-html directory, and then navigate to http://localhost:8000/?argv=%5B%22-h%22%5D&interactive&wasm, you'll get a page that works fine in chrome but fails in firefox (open the console) with "Uncaught (in promise) CompileError: wasm validation error: at offset 9925682: unrecognized opcode: 15 0" or similar (not sure why I get different validation errors sometimes).

The .tar.gz contains the standalone wasm_fiat_crypto.ml used to generate the wasm with -package unix -w -20 -g -package js_of_ocaml -linkpkg and then wasm_of_ocaml --source-map --no-inline.

Expected behavior
The generated code should work in both Chrome and Firefox

Versions
Firefox: 120.0 (64-bit)
ocaml-option-fp.1,ocaml-variants.4.14.1+options

$ wasm_of_ocaml --version
5.3.0+git-f517bbca-dirty
$ ocamlc --version
4.14.1
@vouillon
Copy link
Collaborator

Tail-calls have not been enabled by default in the stable version of Firefox 120, unfortunately.
You can set javascript.options.wasm_tail_calls to true in about:config to enable them. Or you can try with Firefox Beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants