Quick failure mechanisms windows system --- fastfail

Quick failure mechanisms windows system --- fastfail, is a mechanism to "fast failure" request for - a potential method to terminate immediately the process of destruction process requests. Using conventional processing exception handling facility may have been severely damaged and the failing state of the stack to unrecoverable. Use __fastfail terminate the process overhead to a minimum.

Fast independent request failed request, usually only execute two instructions. Once this is done quickly failed requests, the kernel will take appropriate action. Code in user mode, the fast speed when a failure event initiator, in addition to the instruction pointer itself does not exist in any memory dependencies. Even if there is a serious memory corruption can maximize their reliability.

User mode start failure is indicated by a second chance unsustainable abnormality, the abnormality code 0xc0000409, comprising at least one abnormal parameter. The first code is abnormal parameter value. This exception code to the Windows Error Reporting (WER) and debugging infrastructure indicates that the process is corrupt and should be taken within a minimum of process operation in response to failure. Kernel-mode flash failed request by using the error detection code is dedicated KERNEL_SECURITY_CHECK_FAILURE implement (0x139). In both cases, there is no exception handler is invoked, because the program is expected in a damaged state. If the debugger exists, there is the opportunity to state inspection process before terminating the program.

Windows 8 supports native began to fail fast mechanism. Does not support native command of the fail-fast Windows operating system will usually request as quickly defeat an access violation, or is deemed to UNEXPECTED_KERNEL_MODE_TRAP error checking. In these cases, it will still terminate the program, but not necessarily quickly terminated.

windows provides a dedicated internal API to implement such a mechanism ---__ fastfail,

Prototype is as follows:

void __fastfail(unsigned int code);

parameter:

[in] code
WINNT.H or wdm.h in FAST_FAIL_ <description> symbolic constant indicates the reason the process is terminated. Type Description and use of a particular fault condition in the fault report mode into the environment.

return value:

__fastfail internal function does not return.

Internally, you can use several mechanisms architecture-specific implementation __fastfail :

Architecture

instruction

Location code parameter

x86

int 0x29

even

x64

int 0x29

rcx

ARM

Opcode 0xDEFB

r0

When we use the VC ++ compiler, the compiler will automatically link to the function of our program to achieve such a mechanism.

Guess you like

Origin www.cnblogs.com/yilang/p/11820928.html