`wasmtime compile --emit-clif` and `wasmtime hot-blocks` panic on components (NotFound when creating a CLIF file)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in crates/cranelift/src/compiler.rs at the CLIF filename construction and file creation mentioned in the report. Reproduce with a wasm32-wasip2 component using wasmtime compile --emit-clif or wasmtime hot-blocks; compare with a core module. Done when component compilation no longer panics on symbol paths and file creation errors are reported.
Written by the indexing model from the issue text.
Description
Thanks for filing a bug report! Please fill out the TODOs below.
Note: if you want to report a security issue, please read our security policy!
Test Case
Any component triggers it, so no file is attached. A default hello world is enough:
$ cargo new hello && cd hello
$ cargo build --target wasm32-wasip2
Steps to Reproduce
mkdir clif-outwasmtime compile --emit-clif clif-out -o out.cwasm target/wasm32-wasip2/debug/hello.wasm- Or:
wasmtime hot-blocks target/wasm32-wasip2/debug/hello.wasm
Expected Results
CLIF files are written for all functions and compilation succeeds, as it does for a core module. If a file cannot be written, an error is reported instead of a panic.
Actual Results
Both commands panic and the process aborts (exit code 134):
thread '<unnamed>' panicked at crates/cranelift/src/compiler.rs:1641:58:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
For the hello world, 18 CLIF files are written to clif-out before the panic. The same program built for wasm32-wasip1 (a core module) compiles fine with --emit-clif: 289 CLIF files, exit code 0.
Versions and Environment
Wasmtime version or commit: 47.0.3 (5554cc1a6 2026-07-31). The code involved is unchanged on main (checked 2026-12-03).
Operating system: Linux (Ubuntu 22.04)
Architecture: x86_64
Extra Info
Likely cause: in crates/cranelift/src/compiler.rs, the CLIF file name is derived from the function symbol by replacing only : (path.join(symbol.replace(":", "-"))), and the file is then created with std::fs::File::create(path).unwrap(). Component symbols can include interface names such as wasi:cli/[email protected], so a / remains and path.join points into a subdirectory that does not exist. Sanitizing path separators in the file name (or creating parent directories), and returning the I/O error instead of calling unwrap(), would avoid the panic.
- Dominant language
- Rust
- Stars
- 18.9k
- Forks
- 2k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 238
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bytecodealliance/wasmtime
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bytecodealliance/wasmtime#15455 · 1 comment ·
Maintainers usually reply within 1 day
-
wasi-preview1-component-adapter: fd_write does not invalidate cached InputStream, causing stale readsPossibly taken @dpfens claimed this 13 days ago. Openwasi
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bytecodealliance/wasmtime#15296 ·
Maintainers usually reply within 1 day
-
bug wasm-proposal:exceptions wasmtime:debugging
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bytecodealliance/wasmtime#14102 ·
Maintainers usually reply within 1 day
-
wasm-proposal:gc
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
bytecodealliance/wasmtime#13808 · 2 comments ·
Maintainers usually reply within 1 day
-
`Func::call` aborts on OOM when Wasm traps (with name section) or throwsPossibly taken @cfallin claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
bytecodealliance/wasmtime#15529 ·
Maintainers usually reply within 1 day
All issues in bytecodealliance/wasmtime
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
valkey-io/valkey-glide#7975 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
marklauter/tsong#110 ·
-
docs enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wasm-bindgen/wasm-bindgen#5503 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vortex-data/vortex#12633 ·
Maintainers usually reply within 1 day