rust-ffi-guide
rust-ffi-guide copied to clipboard
Unwinding Problem
Problem 2 (link) is about what happens when some function being called from C++ panics. The solutions section should explain why we get a segfault (or UB) when Rust functions panic, why unwinding across the FFI barrier is UB, and what's going on behind the scenes which results in the behaviour we see. It should also mention how you prevent accidentally panicking across the FFI barrier (catch_unwind
).