You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tracking Issue for abort_immediate (abort in core) #154601
This is a tracking issue for core::process::abort_immediate.
abort_immediate aborts/halts/crashes the process with as little overhead as possible. This exposes intrinsics::abort's behavior to stable. This is also reexported as std::process::abort_immediate.
Given we want core::process::abort to opportunistically do std::process::abort if possible and abort_immediate otherwise, do we even want to expose a separate abort_immediate?
Would another name more clearly communicate intent? Options include process::crash, process::halt, or others.
Is core::process a reasonable home for this? It will be the first item.
Would another name more clearly communicate intent? Options include process::crash, process::halt, or others.
I just want to make sure people know I am not strongly in favor of the current naming of panic = "immediate-abort" and I do not want its current name to be used as justification for the name choice here, though of course it makes sense for them to stay in sync. (It would be unfortunate if we end up stuck with this preliminary name) In particular, I am not sure that simply adding "immediate" is clear enough. exit and abort get to lean on existing terminology from other languages (mostly C) and I don't think there is an equivalent for this mechanism.
Arguably, Win32's TerminateProcess vs __fastfail could be understood as the same kind of difference, but our abort is already __fastfail. (Windows's abort is nonconforming and may run loaded DLL's destructors, so isn't appropriate for Rust.)
I think process::crash is the most descriptive considering the description in the ACP (immediately executing an illegal instruction).
halt implies an infinite wait loop where things like interrupts and signals can still be serviced. Like a wfi loop on arm. It reliably hangs the thread of execution, keeping all of its resources alive.
Reacted by Dmitrii Aleksandrov, GrigorenkoPV, robofinch, lolbinarycat and cyrgani
abort_immediate is imo sufficiently descriptive in that it makes it clear what's happening (we're ending the process as quickly as possible). if anything, crash to me sounds like something that would trigger some kind of error logging mechanism via a hook.
I'd also argue this is highly useful to have regardless of there being an opportunistically hook-calling abort in core, since there are cases when the desired behaviour is genuinely "shut everything down asap, don't call anything". my stance would be to stabilise this as-is
Btw, I would ideally want core::process::abort to use __fastfail on Windows because currently the intrinsic throws an SEH exception rather than immediately aborting whereas __fastfail is more like "shut everything down asap". There was controversy in #149780 about changing the intrinsic itself but changing core::process::abort should not have the same issue.
@saethlin did you happen to have any alternative names in mind for immediate-abort?
People have suggested trap and crash. In my own mind, I would pick crash because I do not think we want to specify exactly how the process ends, except that it will probably look like it didn't exit successfully. trap and fault seem to me like there should be a handler that I can install to run when this intrinsic is invoked.
Activity
[-]Tracking Issue for abort in core[/-][+]Tracking Issue for abort_immediate (abort in core)[/+]saethlin commentedon Mar 31, 2026
I just want to make sure people know I am not strongly in favor of the current naming of
panic = "immediate-abort"and I do not want its current name to be used as justification for the name choice here, though of course it makes sense for them to stay in sync. (It would be unfortunate if we end up stuck with this preliminary name) In particular, I am not sure that simply adding "immediate" is clear enough.exitandabortget to lean on existing terminology from other languages (mostly C) and I don't think there is an equivalent for this mechanism.CAD97 commentedon Mar 31, 2026
Arguably, Win32's
TerminateProcessvs__fastfailcould be understood as the same kind of difference, but ourabortis already__fastfail. (Windows'sabortis nonconforming and may run loaded DLL's destructors, so isn't appropriate for Rust.)ChrisDenton commentedon Mar 31, 2026
The purely descriptive name would be
abort-no-hookor something like that?ds84182 commentedon Mar 31, 2026
I think
process::crashis the most descriptive considering the description in the ACP (immediately executing an illegal instruction).haltimplies an infinite wait loop where things like interrupts and signals can still be serviced. Like awfiloop on arm. It reliably hangs the thread of execution, keeping all of its resources alive.Rollup merge of rust-lang#154604 - CAD97:abort-immediate, r=scottmcm
Rollup merge of rust-lang#154604 - CAD97:abort-immediate, r=scottmcm
Unrolled build for #154604
nia-e commentedon Aug 8, 2026
abort_immediateis imo sufficiently descriptive in that it makes it clear what's happening (we're ending the process as quickly as possible). if anything,crashto me sounds like something that would trigger some kind of error logging mechanism via a hook.I'd also argue this is highly useful to have regardless of there being an opportunistically hook-calling abort in core, since there are cases when the desired behaviour is genuinely "shut everything down asap, don't call anything". my stance would be to stabilise this as-is
ChrisDenton commentedon Aug 8, 2026
Btw, I would ideally want
core::process::abortto use__fastfailon Windows because currently the intrinsic throws an SEH exception rather than immediately aborting whereas__fastfailis more like "shut everything down asap". There was controversy in #149780 about changing the intrinsic itself but changingcore::process::abortshould not have the same issue.10 remaining items
tgross35 commentedon Oct 1, 2026
__builtin_trapis the similar C operation to this, so perhaps that's more familiar than the LLVM name.tgross35 commentedon Oct 1, 2026
Added
trapas part of #163575eaglgenes101 commentedon Oct 1, 2026
If we're still accepting bikeshed color submissions, I'd call it
fault.saethlin commentedon Oct 2, 2026
People have suggested
trapandcrash. In my own mind, I would pickcrashbecause I do not think we want to specify exactly how the process ends, except that it will probably look like it didn't exit successfully.trapandfaultseem to me like there should be a handler that I can install to run when this intrinsic is invoked.Rollup merge of rust-lang#163621 - tgross35:const-abort-immediate, r=…
Unrolled build for #163621 in rollup 163630
Rollup merge of rust-lang#163574 - tgross35:intrinsics-abort-rename, …
Unrolled build for #163574 in rollup 163680
Rollup merge of #163574 - tgross35:intrinsics-abort-rename, r=clarfon…
Rollup merge of #163574 - tgross35:intrinsics-abort-rename, r=clarfon…
Rollup merge of #163574 - tgross35:intrinsics-abort-rename, r=clarfon…
Rollup merge of #163621 - tgross35:const-abort-immediate, r=RalfJung,…
Rollup merge of #163574 - tgross35:intrinsics-abort-rename, r=clarfon…
Rollup merge of #163574 - tgross35:intrinsics-abort-rename, r=clarfon…
Rollup merge of #163621 - tgross35:const-abort-immediate, r=RalfJung,…