Stream: git-wasmtime

Topic: wasmtime / issue #7936 Trying to run MIRI on MacOS


view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2024 at 04:06):

rookieCookies added the bug label to Issue #7936.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2024 at 04:06):

rookieCookies opened issue #7936:

Steps to Reproduce

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

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2024 at 06:09):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2024 at 17:17):

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?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2024 at 17:23):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2024 at 17:41):

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?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2024 at 17:51):

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 of cargo 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 the wmemcheck 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.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2024 at 19:54):

alexcrichton closed issue #7936:

Steps to Reproduce

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: Nov 22 2024 at 16:03 UTC