wasmerio / wasmer-js

Monorepo for Javascript WebAssembly packages by Wasmer

Home Page:https://wasmerio.github.io/wasmer-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[0.12.0] RangeError: Invalid typed array length: 4226634690

xesxen opened this issue · comments

I was trying out wasmer with an existing open-source wasm file. Using the CLI (2.1.1), the wasm file works just fine. Using the JS binding generates a JS RangeError.

Do note that the 4,226,634,690 value is rather close to 2^32 (difference being only 68,332,606). The line causing this exception is https://github.com/wasmerio/wasmer-js/blob/0.x/packages/wasi/src/index.ts#L479

As I want to share the same FS between different WASM modules (with different arguments), 1.x is not yet viable for me to use. Sharing the FS instance or changing the command args/env is not possible from the looks of it.

A testcase is available here: https://github.com/xesxen/wasmer-js-bug. cli.sh uses the wasmer CLI, nodejs.js crashes with the same mappings and command arguments configured.

This should be fixed in the current master. Closing