Skip to content
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

investigate "this assumes only one [wasm] can possibly run at a time" comment in context of ROtrx #956

Closed
spoonincode opened this issue Apr 3, 2023 · 2 comments · Fixed by #995
Assignees
Milestone

Comments

@spoonincode
Copy link
Member

A wasm_runtime_interface exposes

//immediately exit the currently running wasm_instantiated_module_interface. Yep, this assumes only one can possibly run at a time.
virtual void immediately_exit_currently_running_module() = 0;

This is pretty interesting as it suggests this function only has defined behavior if a single wasm is executing, which of course is not the case now with ROtrx.

This is called via eosio_exit host function.

void interface::eosio_exit( int32_t code ) const {
context.control.get_wasm_interface().exit();
}

via
void wasm_interface::exit() {
my->runtime_interface->immediately_exit_currently_running_module();
}

So it can absolutely be called via multiple ROtrx at a time.

But... Most likely this is a relic of the way WAVM and/or wabt runtimes were integrated. OC stubs this out as a do-nothing, and EOS VM looks like it throws an exception that likely has proper semantics. I think this "singleton" immediately_exit_currently_running_module() should be completely removed.

@linh2931
Copy link
Member

linh2931 commented Apr 3, 2023

Thanks Matt @spoonincode. Should we just take it out?

@spoonincode
Copy link
Member Author

We'll still need to, I guess, throw an exception for EOS VM in eosio_exit impl. Otherwise yeah I think it can all be ripped out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants