-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for panic::always_abort() #84438
Comments
This would be pretty useful to not have to implement abort bomb every time one wants to handle aborting nicely. That means when a piece of code knows for a fact it has to abort (not panic!) due to safety issues but wants to print/log a message and avoid printing code panicking causing it to skip abort. However from the discussion in the impl PR it seems this sets global flag instead of thread-local one, which is undesirable. If it was guaranteed to be thread-local it'd increase usefulness of this considerably. |
This comment was marked as outdated.
This comment was marked as outdated.
I filed this as a separate issue: #122940. |
Summary of this comment: Let's make this API more future-proof The current/initial use case & implementation of I'm not saying that there will be such other ways at runtime - instead, it may be by other As a minimum, suggest choosing a function name convention, so that more similar functions can be added later, and they
The following examples use // Non-reversible
behavior_global_always_abort()
// "xyz", "abc", "pqr" represent a name for the behavior:
// Reversible, using _undo postfix
behavior_global_xyz()
behavior_global_xyz_undo()
// Non-reversible, local thread only
behavior_thread_abc()
// Reversible, local thread, using _on() and _off() postfix - probably not a good choice of postfixes, here only as an example
behavior_thread_pqr_on()
behavior_thread_pqr_off()
// Non-reversible, a scope of threads. If used with std::thread::scope(), the reference here can't be mutable, so this needs some interior mutability; it could probably be called only before creating any scoped threads. Most likely too expensive to have a way to reverse.
behavior_scoped_xyz(&'std::thread::Scope) Again, I'm not saying that there will ever be Also, if we rename this function, suggest changing the Side note: There are only two consumers of the current feature & function (other than Side question: While I don't think we have to notify |
Feature gate:
#![feature(panic_always_abort)]
This is a tracking issue for
std::panic::always_abort()
.This function causes all future panics to abort. It is useful in the child after
libc::fork
, andCommand
uses it for that.Public API
Steps / History
Unresolved Questions
The text was updated successfully, but these errors were encountered: