Closed kenorb closed 2 years ago
You are using wasmtime 0.37. The latest released version is 0.40.1. Can you check if it is fixed with 0.40.1?
Thanks for suggestion. I've updated to 0.40.1, same error.
$ wasmtime --version
wasmtime-cli 0.40.1
$ wasmtime php-worker.wasm -- --version
thread '<unnamed>' panicked at 'index out of bounds: the len is 2097152 but the index is 2097152', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/regalloc2-0.3.2/src/lib.rs:270:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
look like the compilation unit is too big.
This is a slightly minimized input, but I believe that @yuyang-ok is right in that this input is seemingly too large for regalloc2. Presuming that this isn't easy to fix within regalloc2
(cc @cfallin) we will want a better error for this, so one thing we could try to do is limit the number of instructions per function. I'm not sure if browsers do that already to draw inspiration from.
It almost certainly is a too-large function indeed; there is a limit of 2M vregs due to performance-critical bitpacking tricks. Will take a closer look tomorrow when I’m back at a computer!
Full backtrace:
Any ideas why this crashes? Is is a problem with the wasm file or wasmtime?