Use __fastfail in libpanic_abort on Windows #73215
Labels
A-runtime
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
O-windows
Operating system: Windows
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
libpanic_abort currently uses Rust's abort intrinsic for aborts (which uses an illegal opcode to abort the process). This directly contrasts with libstd which uses inline assembly to call into Windows __failfail intrinsic. This is preferred because __fastfail allows for debuggers to attach after the process has aborted for debugging.
Perhaps we should use the same abort implementation used in libstd for libpanic_abort.
Drawbacks
Before Windows 8 __fastfail wasn't available and so calling into it on this platforms leads to an access violation. Access violations are not catchable by normal exception handlers but are catchable by [SEH}(https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling)
The text was updated successfully, but these errors were encountered: