Skip to content

Failing inside Binaryen during execution #5

@RReverser

Description

@RReverser

When trying to execute arbitrary WASI program compiled from C / Rust, it throws an error somewhere inside Binaryen:

> npx wasm-trace -E temp.wasm                                                                    
[tracer] Instrumenting and optimizing...
[tracer] Running WASI...
[TypeError: WebAssembly.instantiate(): Import #0 module="wasi_snapshot_preview1" error: module is not an object or function]
[TypeError: WebAssembly.instantiate(): Import #0 module="wasi_snapshot_preview1" error: module is not an object or function]

C:\Users\rreverser\AppData\Local\npm-cache\_npx\dd4973ce67a8a99d\node_modules\binaryen\index.js:7
if(m)n=__dirname+"/",ja=function(b,d){var g=p(b);if(g)return d?g:g.toString();ma||(ma=require("fs"));na||(na=require("path"));b=na.normalize(b);return ma.readFileSync(b,d?null:"utf8")},la=function(b){b=ja(b,!0);b.buffer||(b=new Uint8Array(b));assert(b.buffer);return b},1<process.argv.length&&(ba=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(b){if(!(b instanceof oa))throw b;}),process.on("unhandledRejection",q),da=function(b){process.exit(b)},a.inspect=


                                                                                                                                      ^        
abort(TypeError: WebAssembly.instantiate(): Import #0 module="wasi_snapshot_preview1" error: module is not an object or function). Build with -s ASSERTIONS=1 for more info.
(Use `node --trace-uncaught ...` to show where the exception was thrown)
npm ERR! code 7
npm ERR! path C:\src\v8.dev
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c wasm-trace -E temp.wasm

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\rreverser\AppData\Local\npm-cache\_logs\2021-02-19T12_13_12_289Z-debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions