Stabilise abort_immediate - #160766
Conversation
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
It would probably be good to replace uses of |
|
Only potential confusion is |
happy to roll that into this pr, since this just wraps the intrinsic
hmm, fair. in that case still i'd let the team rule on the preferred naming here |
|
Yeah, fine with the team deciding on the naming, but I think Bad suggestion: |
|
|
|
I can't really think of anything much better. The most important property is that it tries to terminate the process without doing anything else (if possible) or at least a minimal amount of other things. The only thing I can think of is something like |
|
I guess that it doesn't technically matter if the two names don't have the same exact semantics because the idea of immediately aborting is the same in both cases. And the rearranged words helps to indicate that they might be different. |
I think it would be better if we could get consensus to not do that, i.e., keep For example, glibc |
|
IMO it is UB to install signal handlers that do anything "weird", so the SIGABRT argument is not very convincing to me. But I agree with the rest. |
|
The naming could be confusing since |
It's certainly ill-advised to do anything non-trivial, and in practice almost every signal handler I've ever seen is not quite async-signal-safe and thus UB anyway. But having a SIGABRT handler at all isn't too weird if you e.g. want to make sure you restore terminal state on exit. And more generally: async-signal-safe code has to be able to abort somehow (panic isn't AS-safe). While |
|
async-signal-safety is a necessary condition for code in such a signal handler, but not a sufficient one. The rest of the program generally gets to assume that signal handlers don't interfere with the normal program execution. |
There was a problem hiding this comment.
This paragraph feels a bit weird to me since it tries to define what an interrupt is to people operating on bare-metal targets as if they've only worked with OS targets before.
Not exactly sure what a better version would look like, but this feels very strange.
| @@ -34,7 +35,7 @@ | |||
| /// corresponds to `SIGILL` or equivalent, *unless* this signal is handled. | |||
| /// Other signals such as `SIGABRT`, `SIGTRAP`, `SIGSEGV`, and `SIGBUS` may be | |||
| /// produced instead, depending on specifics. This is not an exhaustive list. | |||
There was a problem hiding this comment.
As mentioned in the signal handling discussion, we probably should just put our foot down somewhat on this and say that you generally should not try and intercept whatever signal gets raised by this, and instead rely on the regular abort if you want predictable mechanics.
|
How about |
|
|
Closes #154601 by stabilising the feature. Explicitly do not promise any particular behaviour beyond aborting in some nonspecific violent fashion.
The ACP for the relevant feature was accepted 2 years ago and the feature has been on nightly for 5 months with the only apparent concerns being related to naming and the possibility of having a version of
abortin core that guarantees calling the system abort if available, but such an implementation is blocked on EIIs and there is merit to offering this in parallel as well. Additionally, the nonspecific semantics ofabort_immediatelet us change its behaviour to opportunistically callabortin the future if so desired.