-
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
Panic when reentering wasm_func_call
from C API.
#365
Comments
peterhuene
changed the title
Panic when reentering
Panic when reentering Sep 24, 2019
wasm_func_call
.wasm_func_call
from C API.
peterhuene
added a commit
to peterhuene/wasmtime
that referenced
this issue
Sep 24, 2019
This commit fixes the borrow scope of `store` in `wasm_func_call` such that it does not remain borrowed across the call to `wasmtime_call_trampoline`. By limiting the scope of the borrow, `wasm_func_call` can be reentered if an exported function calls an imported function, which in turn calls another exported function. Fixes bytecodealliance#365.
peterhuene
added a commit
to peterhuene/wasmtime
that referenced
this issue
Sep 25, 2019
This PR fixes the borrow scope of store in the `WrappedCallable` impl of `WasmTimeFn` such that it does not remain borrowed across the call to `wasmtime_call_trampoline`. By limiting the scope of the borrow, the implementation can be reentered if an exported function calls an imported function, which in turn calls another exported function. Fixes bytecodealliance#365.
peterhuene
added a commit
to peterhuene/wasmtime
that referenced
this issue
Sep 26, 2019
This PR fixes the borrow scope of store in the `WrappedCallable` impl of `WasmTimeFn` such that it does not remain borrowed across the call to `wasmtime_call_trampoline`. By limiting the scope of the borrow, the implementation can be reentered if an exported function calls an imported function, which in turn calls another exported function. Fixes bytecodealliance#365.
sunfishcode
pushed a commit
that referenced
this issue
Sep 26, 2019
This PR fixes the borrow scope of store in the `WrappedCallable` impl of `WasmTimeFn` such that it does not remain borrowed across the call to `wasmtime_call_trampoline`. By limiting the scope of the borrow, the implementation can be reentered if an exported function calls an imported function, which in turn calls another exported function. Fixes #365.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Repro
With the following WASM module:
Define an import for
get
that calls exported functionsa
andb
on the instance (here is an example of doing so from a prototype C# binding for Wasmtime):Expected Result
The program should output:
Actual Result
The program panics:
Additional Information
The problem appears to be the scope of the borrow for
store
, which remains borrowed across the call towasmtime_call_trampoline
. This prevents any imported function from calling an exported function.The text was updated successfully, but these errors were encountered: