-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GC] Illegal instruction #10181
Comments
Thanks for the bug report! If you have time, minimizing the test case |
I'll take this. |
Where is this wasm file from, and how did you compile it? |
This code relies on the Wasm GC proposal. This proposal is not supported by |
You're definitely welcome to investigate this bug, but this isn't likely the best good-first-issue kind of bug if you aren't already somewhat familiar with Wasmtime and Cranelift. What would be super helpful whether you continue to investigate this bug or leave it for someone else would be to run
And when
Wasmtime always validates the Wasm as part of its process of translating it to Cranelift's IR (called CLIF) so, barring validator bugs, we should never actually execute any invalid Wasm file. |
I have used |
We encountered an "Illegal Instruction" error in our project (scala-wasm fork of Scala.js to support wasm component model). The error occurs at least when we try to set an (module
(type $c.scala.Tuple1 (sub (struct
(field $f.scala.Tuple1._1 (mut anyref)))))
(func (export "test")
(local $instance (ref $c.scala.Tuple1))
i32.const -1
ref.i31
struct.new $c.scala.Tuple1
drop
)
) $ wasm-tools parse test.wat -o test.wasm
$ wasmtime run -W function-references,gc --invoke test test.wasm
make: *** [run] Illegal instruction: 4 see: https://github.com/tanishiking/kitchensink/tree/main/wasmtime-illegal-instruction
|
This particular example #10181 (comment) has fixed in local-built wasmtime (287e8fb) 🎉 not sure what was the fix though. We still hit the |
Enabling GC causes an illegal instruction error, bytecodealliance/wasmtime#10181 and in rare cases, the content of array/struct changes unexpectedly during execution (though I haven't been able to create a reproducible test case for this). For now, continue development with `-C collector=null`.
Test Case
constprop.zip
Steps to Reproduce
Run the following command:
Expected Results
This works fine if one add the
-C collector=null
option:Actual Results
This crashes with an
Illegal instruction
error.Versions and Environment
Wasmtime commit: 0e05600
Operating system: Linux
Architecture: x64
The text was updated successfully, but these errors were encountered: