Skip to content

Use __fastfail in libpanic_abort on Windows #73215

@rylev

Description

@rylev

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.O-windowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions