Open cataggar opened 1 week ago
When trying to run locally, it is not responding when calling TypedFunction::call
https://github.com/bytecodealliance/wizer/blob/v7.0.5/src/lib.rs#L894
~/ms/wizer> RUST_LOG=debug cargo run --release --features="env_logger structopt wasmprinter" -- --allow-wasi --init-func componentize.wizer --dir=/Users/cataggar/ms/StarlingMonkey15/b0c26fbad66e/sources --wasm-bulk-memory=true -o=/Users/cataggar/ms/StarlingMonkey15/b0c26fbad66e/out2.wasm /Users/cataggar/ms/StarlingMonkey15/b0c26fbad66e/in.wasm
Compiling wizer v7.0.5 (/Users/cataggar/ms/wizer)
Finished `release` profile [optimized] target(s) in 5.10s
Running `target/release/wizer --allow-wasi --init-func componentize.wizer --dir=/Users/cataggar/ms/StarlingMonkey15/b0c26fbad66e/sources --wasm-bulk-memory=true -o=/Users/cataggar/ms/StarlingMonkey15/b0c26fbad66e/out2.wasm /Users/cataggar/ms/StarlingMonkey15/b0c26fbad66e/in.wasm`
[2024-09-16T16:26:26Z DEBUG wizer] Validating input Wasm
[2024-09-16T16:26:26Z DEBUG wizer::parse] Parsing the input Wasm
[2024-09-16T16:26:26Z DEBUG wizer::instrument] Instrumenting the input Wasm
[2024-09-16T16:26:26Z DEBUG wasmtime_cache::worker] Cache worker thread started.
[2024-09-16T16:26:26Z DEBUG wasmtime_cache::worker] New nice value of worker thread: 3
[2024-09-16T16:26:26Z DEBUG wizer] Preopening directory: /Users/cataggar/ms/StarlingMonkey15/b0c26fbad66e/sources
[2024-09-16T16:26:26Z DEBUG wasmtime::runtime::code_memory] ignoring section .wasmtime.engine
[2024-09-16T16:26:26Z DEBUG wasmtime::runtime::code_memory] ignoring section .symtab
[2024-09-16T16:26:26Z DEBUG wasmtime::runtime::code_memory] ignoring section .strtab
[2024-09-16T16:26:26Z DEBUG wasmtime::runtime::code_memory] ignoring section .shstrtab
[2024-09-16T16:26:26Z DEBUG wizer] Validating the exported initialization function
[2024-09-16T16:26:26Z DEBUG wizer] Calling the initialization function
[2024-09-16T16:26:26Z DEBUG wizer::dummy] Creating dummy imports
[2024-09-16T16:26:26Z DEBUG wizer::dummy] done Creating dummy imports
[2024-09-16T16:26:26Z DEBUG wizer] going to instantiate linker
[2024-09-16T16:26:26Z DEBUG wizer] going to get_export
[2024-09-16T16:26:26Z DEBUG wizer] going to get_typed_func
[2024-09-16T16:26:26Z DEBUG wizer] going to call init_func
I added a few debug statements like log::debug!("going to call init_func");
to see what was going on.
I've transferred this issue into ComponentizeJS, as it's a componentize error.
Ideally we'd debug the Wasm stack here to determine the source of the panic in StarlingMonkey, but without debug tracing it's not possible to do that, so this will be very tricky to debug, down to adding a bunch of log statements to StarlingMonkey source itself to see where it's stopping.
The better debugging approach for now would be to run a bisection on the JS code running itself - try break the bundle down into the libraries you're trying to run and try running those libraries one by one, until you get the panic.
Note that syntax / runtime errors should display as normal JS errors with an error log.
I've added https://github.com/bytecodealliance/ComponentizeJS/issues/137 to track getting better debug stacks, although this depends on work in Orca.
Hi, I'm getting a wizer error when trying to use jco. This is a continuation of troubleshooting of https://github.com/bytecodealliance/StarlingMonkey/issues/15#issuecomment-2350455813. In
jco/node_modules/@bytecodealliance/componentize-js/src/componentize.js
, I turned on debugging.I pushed the output debugging sources to https://github.com/cataggar/StarlingMonkey15/tree/main/b0c26fbad66e