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

Unimplemented: catch_unwind intrinsic #267

Open
danielsn opened this issue Jun 25, 2021 · 3 comments
Open

Unimplemented: catch_unwind intrinsic #267

danielsn opened this issue Jun 25, 2021 · 3 comments
Assignees
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. [E] Unsupported Construct Add support to an unsupported construct

Comments

@danielsn
Copy link
Contributor

danielsn commented Jun 25, 2021

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 danielsn self-assigned this Jun 25, 2021
@danielsn danielsn added this to To do in Sprint 2021-07-06 via automation Jun 25, 2021
@danielsn danielsn moved this from To do to In progress in Sprint 2021-07-06 Jun 29, 2021
@danielsn
Copy link
Contributor Author

Test case added in cbmc/Intrinsics/fixme_try.rs

@danielsn danielsn moved this from In progress to Done in Sprint 2021-07-06 Jun 30, 2021
@zhassan-aws zhassan-aws added [C] Bug This is a bug. Something isn't working. MLP - Must Have labels Mar 15, 2022
@zhassan-aws
Copy link
Contributor

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

@zhassan-aws zhassan-aws added [C] Feature / Enhancement A new feature request or enhancement to an existing feature. and removed [C] Bug This is a bug. Something isn't working. MLP - Must Have labels Mar 18, 2022
@adpaco-aws adpaco-aws changed the title try intrinsic is unimplemented, but required for firecracker Unimplemented: try intrinsic Mar 30, 2022
@tedinski tedinski added the [E] Unsupported Construct Add support to an unsupported construct label Nov 14, 2022
@adpaco-aws adpaco-aws changed the title Unimplemented: try intrinsic Unimplemented: catch_unwind intrinsic Mar 1, 2024
@adpaco-aws
Copy link
Contributor

Renamed the issue since try was renamed to catch_unwind in rust-lang/rust#121598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. [E] Unsupported Construct Add support to an unsupported construct
Projects
No open projects
Development

No branches or pull requests

4 participants