Catching "no binaryen method succeeded" under Chrome

106 views
Skip to first unread message

Sylvain

unread,
Oct 5, 2018, 5:35:51 AM10/5/18
to emscripte...@googlegroups.com

Hi,

Due to using EMULATE_FUNCTION_POINTER_CASTS (required for Python) I get when compiling:
BINARYEN_ASYNC_COMPILATION disabled due to user options. This will reduce performance and compatibility (some browsers limit synchronous compilation)

This indeed causes an error in Chrome:
failed to compile wasm module: RangeError: WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread.
Assertion failed: no binaryen method succeeded.

Currently I have an alternate version compiled in asmjs (with decreased perf), and I blindly redirect to it when I detect Chrome.

- Assuming Chrome fixes this later, is there a way to cleanly catch this "no binaryen method succeeded"?

- Incidentally, what would be required to make EMULATE_FUNCTION_POINTER_CASTS compatible with Chrome wasm?

Cheers!
Beuc

Sam Clegg

unread,
Oct 5, 2018, 7:13:18 PM10/5/18
to emscripte...@googlegroups.com
I think the thing we really want to fix here is the fact the async
compilation is disabled under certain circumstances. For projects of
any reasonable size we want to always be doing async compiles, which
will fix the issue on chrome. I'm not sure exactly which combination
of flags trigger "BINARYEN_ASYNC_COMPILATION disabled due to user
options" but we should work to remove this limitation.
> --
> You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Beuc

unread,
Oct 5, 2018, 7:32:08 PM10/5/18
to emscripte...@googlegroups.com
Yeah that's my second point basically.
Check tools/shared.py:is_wasm_only() for the flags.
(Incidentally, any chance this issue could be fixed in chrom*? ;))

Alon Zakai

unread,
Oct 6, 2018, 9:56:36 AM10/6/18
to emscripte...@googlegroups.com
Looks like recent improvements make it easy to remove this specific limitation, I opened


Beuc

unread,
Oct 6, 2018, 12:21:29 PM10/6/18
to emscripte...@googlegroups.com

Thanks a lot, -incoming with this patch runs fine in my Chromium :)

- Sylvain

Reply all
Reply to author
Forward
0 new messages