Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Use catch_unwind in the FFI #746

Open
thomcc opened this issue Jun 16, 2018 · 2 comments
Open

Use catch_unwind in the FFI #746

thomcc opened this issue Jun 16, 2018 · 2 comments

Comments

@thomcc
Copy link
Contributor

thomcc commented Jun 16, 2018

It's undefined behavior for us to unwind into C, which is extremely bad news.

@ncalexan
Copy link
Member

A quick read shows that catch_panic is unstable, so we can't do this quite yet. In the interim, do you know what the best approach is? And even when catch_panic is available, is the content of this ticket that we need to wrap every FFI entry point that might panic with a closure?

@thomcc
Copy link
Contributor Author

thomcc commented Jun 19, 2018

Sorry, the stable name is catch_unwind. https://doc.rust-lang.org/std/panic/fn.catch_unwind.html

is the content of this ticket that we need to wrap every FFI entry point that might panic with a closure?

Yes. Which in practice probably means almost all of them, if not all.

@thomcc thomcc changed the title Use catch_panic in the FFI Use catch_unwind in the FFI Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants