-
Notifications
You must be signed in to change notification settings - Fork 43
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
Remove error handler invocation as a result of an unwind #302
Comments
This does seem like it would simplify things and make error handling more predictable, but I think it would be good to combine it with compiler warnings about checking the result of compartment calls as per CHERIoT-Platform/llvm-project#34 . |
davidchisnall
added a commit
that referenced
this issue
Oct 3, 2024
I originally made a forced unwind out of a compartment invoke the caller's error handler (if it existed) with a special error code. The idea was that you could use error handlers to jump to recovery paths, rather than checking return values. This seemed like a good idea at the time, but turned out to be a mistake. The only code that has ever used this behaviour was the test suite. Other error handlers have special-case logic to check if this is the reason and ignore it if so. It also added a lot of confusing control flow in the switcher, which is bad because the switcher is the core of the TCB. Fixes #302
davidchisnall
added a commit
that referenced
this issue
Oct 4, 2024
I originally made a forced unwind out of a compartment invoke the caller's error handler (if it existed) with a special error code. The idea was that you could use error handlers to jump to recovery paths, rather than checking return values. This seemed like a good idea at the time, but turned out to be a mistake. The only code that has ever used this behaviour was the test suite. Other error handlers have special-case logic to check if this is the reason and ignore it if so. It also added a lot of confusing control flow in the switcher, which is bad because the switcher is the core of the TCB. Fixes #302
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we have the following flow:
This was useful in the test suite for checking that tests do not terminate unexpectedly. So far, it has been annoying in 100% of all other cases, and every error handler that we've written has a special case to silently ignore it.
This might not be the worst idea I ever had, but it's definitely near the top of the list. Removing this path would also simplify the switcher code.
The text was updated successfully, but these errors were encountered: