Skip to content

Unimplemented: catch_unwind intrinsic #267

Description

@danielsn

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?

Activity

  1. self-assigned this
    on Jun 25, 2021
  2. danielsn commented on Jun 29, 2021

    @danielsn
    ContributorAuthor

    Test case added in cbmc/Intrinsics/fixme_try.rs

  3. zhassan-aws commented on Mar 18, 2022

    @zhassan-aws
    Contributor

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

  4. added
    [C] Feature / EnhancementA new feature request or enhancement to an existing feature.
    and removed
    [C] BugThis is a bug. Something isn't working.
    on Mar 18, 2022
  5. changed the title [-]`try` intrinsic is unimplemented, but required for firecracker[/-] [+]Unimplemented: `try` intrinsic[/+] on Mar 30, 2022
  6. changed the title [-]Unimplemented: `try` intrinsic[/-] [+]Unimplemented: `catch_unwind` intrinsic[/+] on Mar 1, 2024
  7. adpaco commented on Mar 1, 2024

    @adpaco
    Contributor

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

  8. self-assigned this
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Z-Kani CompilerIssues that require some changes to the compiler[C] Feature / EnhancementA new feature request or enhancement to an existing feature.[E] Unsupported ConstructAdd support to an unsupported construct

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions