kani icon indicating copy to clipboard operation
kani copied to clipboard

Unimplemented: `catch_unwind` intrinsic

Open danielsn opened this issue 3 years ago • 3 comments

Only remaining issue from #158

https://doc.rust-lang.org/std/intrinsics/fn.try.html https://doc.rust-lang.org/src/core/intrinsics.rs.html#1717 https://doc.rust-lang.org/std/panic/fn.catch_unwind.html

try makes a best-effort attempt to recover from panics - if the code in the first function pointer crashes with a panic, rust will try to run the cleanup code in the second function pointer.

It is not clear to me what the right semantics are here. For now, handling this as a unimplemented allows us to soundly move forward, but it might be more accurate to actually call the first function pointer. I don't know of a nice way to do the unwinding on panic - maybe CBMC has a mechanism?

danielsn avatar Jun 25 '21 20:06 danielsn

Test case added in cbmc/Intrinsics/fixme_try.rs

danielsn avatar Jun 29 '21 20:06 danielsn

try likely requires the panic unwind strategy (doesn't work with abort).

zhassan-aws avatar Mar 18 '22 19:03 zhassan-aws

Renamed the issue since try was renamed to catch_unwind in https://github.com/rust-lang/rust/pull/121598

adpaco-aws avatar Mar 01 '24 15:03 adpaco-aws