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

Reconsider panic::catch_unwind pattern in extern "C" functions #1692

Open
daira opened this issue Feb 24, 2025 · 0 comments
Open

Reconsider panic::catch_unwind pattern in extern "C" functions #1692

daira opened this issue Feb 24, 2025 · 0 comments
Labels
C-tech-debt rust_related For errors in the SDK that are related to the Rust code and thereby probably need help from Core.

Comments

@daira
Copy link
Contributor

daira commented Feb 24, 2025

Rust 1.81.0 started aborting on uncaught panics in extern "C" functions, which fixed the soundness hole that I think originally caused us to have to use panic::catch_unwind in all such functions for safety.

We should reconsider whether we want to continue to use this error-handling pattern, especially in cases where a panic could leave a mutable object (like tor_runtime here) in an undefined state.

@daira daira added rust_related For errors in the SDK that are related to the Rust code and thereby probably need help from Core. C-tech-debt labels Feb 24, 2025
@daira daira changed the title Reconsider catch_unwind pattern in extern "C" functions Reconsider panic::catch_unwind pattern in extern "C" functions Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tech-debt rust_related For errors in the SDK that are related to the Rust code and thereby probably need help from Core.
Projects
None yet
Development

No branches or pull requests

1 participant