-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Call into fastfail on abort in libpanic_abort on Windows x86(_64) #75364
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
Conversation
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
1c03f00
to
57572cf
Compare
Is there a reason to duplicate the code instead of calling already existing function? |
The function is not available as it's defined in standard and panic_abort is |
The already existing function only exists in libstd I believe which panic_abort can't depend on. I'm not sure what's up with |
@alexcrichton would you feel comfortable taking this review? I definitely don't understand it enough. |
Sure! @bors: r+ |
📌 Commit b9b8b5c has been approved by |
☀️ Test successful - checks-actions, checks-azure |
This partially resolves #73215 though this is only for x86 targets. This code is directly lifted from libstd.
__fastfail
is the preferred way to abort a process on Windows as it will hook into debugger toolchains.Other platforms expose a
_rust_abort
symbol which wrapsstd::sys::abort_internal
. This would also work on Windows, but is a slightly largely change as we'd need to make sure that the symbol is properly exposed to the linker. I'm inlining the call to the__fastfail
, but the indirection throughrust_abort
might be a cleaner approach.A different instruction must be used on ARM architectures. I'd like to verify this works first before tackling ARM.