-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Wasmtime: missing trampolines for declarative element segments (should be treated as possibly exported). #2850
Labels
bug
Incorrect behavior in the current implementation that needs fixing
Comments
peterhuene
added
the
bug
Incorrect behavior in the current implementation that needs fixing
label
Apr 20, 2021
cc: @alexcrichton |
Also, this failure was first observed in |
Whoops I completely missed that declarative element segments were skipped entirely in the translation phase, that's definitely a bug! I'll look to fix. |
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this issue
Apr 20, 2021
Now that we're using "possibly exported" as an impactful decision for codegen (which trampolines to generate and which ABI a function has) it's important that we calculate this property of a wasm function correctly! Previously Wasmtime forgot to processed "declared" elements in apart from active/passive element segments, but this updates Wasmtime to ensure that these entries are processed and all the functions contained within are flagged as "possibly exported". Closes bytecodealliance#2850
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this issue
Apr 20, 2021
Now that we're using "possibly exported" as an impactful decision for codegen (which trampolines to generate and which ABI a function has) it's important that we calculate this property of a wasm function correctly! Previously Wasmtime forgot to processed "declared" elements in apart from active/passive element segments, but this updates Wasmtime to ensure that these entries are processed and all the functions contained within are flagged as "possibly exported". Closes bytecodealliance#2850
alexcrichton
added a commit
that referenced
this issue
Apr 20, 2021
Now that we're using "possibly exported" as an impactful decision for codegen (which trampolines to generate and which ABI a function has) it's important that we calculate this property of a wasm function correctly! Previously Wasmtime forgot to processed "declared" elements in apart from active/passive element segments, but this updates Wasmtime to ensure that these entries are processed and all the functions contained within are flagged as "possibly exported". Closes #2850
mchesser
pushed a commit
to mchesser/wasmtime
that referenced
this issue
May 24, 2021
…codealliance#2851) Now that we're using "possibly exported" as an impactful decision for codegen (which trampolines to generate and which ABI a function has) it's important that we calculate this property of a wasm function correctly! Previously Wasmtime forgot to processed "declared" elements in apart from active/passive element segments, but this updates Wasmtime to ensure that these entries are processed and all the functions contained within are flagged as "possibly exported". Closes bytecodealliance#2850
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test Case
Repro to run with
main
:This is a paired down test case that is currently causing the
wasmtime-dotnet
CI to fail.Steps to Reproduce
On Windows:
cargo new --bin repro
cargo add wasmtime
(change path to local wasmtime repo)cargo run
Expected Results
success!
should be printed.Actual Results
Panic due to failure to find trampoline (for signature
(externref) -> ()
, i.e. the funcref passed tocallback
):Versions and Environment
Wasmtime version or commit:
main
Operating system: Windows 10
Architecture: x86-64
Extra Info
I believe this is caused by #2806.
I think the problem here is that we're failing to determine that
$f
may be possibly exported from the module as the element segment is declarative and not active or passive. Right now the section translator does nothing for declarative element segments; with the changes from #2806 we should consider all declarative elements as potentially exported functions as the reference might escape the module.Note: by changing
$f
to have a signature of() -> ()
, it runs to completion because it uses the trampoline ofg
.The text was updated successfully, but these errors were encountered: