rookieCookies added the bug label to Issue #7936.
rookieCookies opened issue #7936:
Steps to Reproduce
- Make a new cargo project
- Add
wasmtime = "*"
- Do
cargo miri run
Expected Results
Miri compiles and runs successfully
Actual Results
Failed to compile because of something inside the crate itself. I looked into the module traphandlers and sure enough there is no function named that
error[E0425]: cannot find function `using_mach_ports` in module `traphandlers` --> /Users/macbook/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-runtime-17.0.1/src/traphandlers.rs:52:23 | 52 | traphandlers::using_mach_ports(), | ^^^^^^^^^^^^^^^^ not found in `traphandlers` For more information about this error, try `rustc --explain E0425`.
Versions and Environment
Wasmtime version or commit: 17.0.1
Operating system: MacOS
Architecture: ARM
bjorn3 commented on issue #7936:
Miri is unable to interpret jitted code, so even if this compile error is fixed, you still wouldn't be able to run wasm modules using wasmtime inside miri. It should be possible to compile wasm modules without actually running them though once this error is fixed.
rookieCookies commented on issue #7936:
It should be possible to compile wasm modules without actually running them though once this error is fixed.
Why? Can't it run in interpret-only mode?
cfallin commented on issue #7936:
Why? Can't it run in interpret-only mode?
Wasmtime doesn't have an interpreter tier, unfortunately; all Wasm execution depends on running native code generated by Cranelift.
rookieCookies commented on issue #7936:
Wasmtime doesn't have an interpreter tier, unfortunately; all Wasm execution depends on running native code generated by Cranelift.
Ahh, seriously? Bit unrelated to the PR but do you know of any way I can miri wasm?
bjorn3 commented on issue #7936:
If you want to run miri on some code you want to compile to wasm, you did have to use
cargo miri run --target wasm32-wasi
instead ofcargo run --target wasm32-wasi
. Miri currently doesn't support wasi though afaik. You can't run miri on a wasm module. Miri can only run the MIR intermediate representation of rustc. After compilation to wasm only something like valgrind which uses dynamic instrumentation and heuristics about the source language is possible. It just so happens that wasmtime already has support for something like this behind the-W wmemcheck
flag: https://github.com/bytecodealliance/wasmtime/blob/main/docs/wmemcheck.md You will need to recompile wasmtime with thewmemcheck
cargo feature enable for this and as I said it uses heuristics and doesn't catch all UB something like miri would catch. For example violations of the stacked borrows rules or invalid values are not catched.
alexcrichton closed issue #7936:
Steps to Reproduce
- Make a new cargo project
- Add
wasmtime = "*"
- Do
cargo miri run
Expected Results
Miri compiles and runs successfully
Actual Results
Failed to compile because of something inside the crate itself. I looked into the module traphandlers and sure enough there is no function named that
error[E0425]: cannot find function `using_mach_ports` in module `traphandlers` --> /Users/macbook/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-runtime-17.0.1/src/traphandlers.rs:52:23 | 52 | traphandlers::using_mach_ports(), | ^^^^^^^^^^^^^^^^ not found in `traphandlers` For more information about this error, try `rustc --explain E0425`.
Versions and Environment
Wasmtime version or commit: 17.0.1
Operating system: MacOS
Architecture: ARM
Last updated: Dec 23 2024 at 12:05 UTC