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

Exceptions don't propagate back up through the runtime #759

Closed
Qix- opened this issue Mar 12, 2021 · 2 comments
Closed

Exceptions don't propagate back up through the runtime #759

Qix- opened this issue Mar 12, 2021 · 2 comments

Comments

@Qix-
Copy link
Contributor

Qix- commented Mar 12, 2021

If a host function calls an exported WASM function, which in turn calls an imported host function, and the host function throws an exception, I would have expected the exception be thrown all the way back up to the originating host function - however, the application just crashes.

Is there something internally happening that prevents exceptions from being propagated correctly?

@axic
Copy link
Member

axic commented Mar 12, 2021

Hmm, do you have some small self-contained example? What version are you using, 0.7.0 or master? In master we are right now undergoing some changes to make execution "noexcept", due to speed reasons, which would not allow propagating exceptions, rather host functions would need to return a trap. And we would need to add a way to attach some user-defined message to the trap.

@Qix-
Copy link
Contributor Author

Qix- commented Mar 12, 2021

Nothing self-contained but I can probably come up with one if need be.

However your explanation makes a lot of sense - I'm working from master, and the application seems to abort so that would make sense. Being able to attach data to a trap would be nice, though!

I have all of my bound functions wrapped with a single stub so this is actually quite easy to do for now (I can just store the exception somewhere and re-throw if I detect a trap). I'll give that a shot.

Thanks for the quick response :)

@Qix- Qix- closed this as completed Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants