A general protection fault (GPF) in the x86 instruction set architectures (ISAs) is a fault (a type of interrupt) initiated by ISA-defined protection mechanisms in response to an access violation caused by some running code, either in the kernel or a user program.
If a CPU detects a protection violation, it stops executing the code and sends a GPF interrupt.
The IBM PC AT, the first PC-compatible system to contain an 80286, has hardware that detects the Shutdown state and automatically resets the CPU when it occurs.
In Microsoft Windows, the general protection fault presents with varied language, depending on product version: Terminating current application.
Examples include: However, many modern operating systems implement their memory access-control schemes via paging instead of segmentation, so it is often the case that invalid memory references in operating systems such as Windows are reported via page faults instead of general protection faults.
Operating systems typically provide an abstraction layer (such as exception handling or signals) that hides whatever internal processor mechanism was used to raise a memory access error from a program, for the purposes of providing a standard interface for handling many different types of processor-generated error conditions.
If a program which is not part of the operating system attempts to use one of these features, it may cause a general protection fault.
As a consequence of their reservation, they are read-only and an attempt to write data to them by an unprivileged program produces an error.