A General Protection Fault (GPF) in the Intel x86 and AMD x86-64 architectures, and other unrelated architectures is a fault (a type of an interrupt) which can encompass several cases, where protection mechanisms within the processor architecture are violated by any of the programs that is running, whether it be the kernel or user program.
The mechanism is first described in section 9.8.13 in Intel 80386 Programmer’s reference manual from 1986. The General Protection Fault is implemented as an interrupt (vector number 13) in both x86 and AMD64-architectures.
If the processor detects a protection violation it stops executing the code and sends a General Protection Fault interrupt.
In most cases, the operating system will simply remove the failing process from the execution queue, signal the user and continue executing another program. If however the operating system fails to catch the General Protection Fault, i.e. another protection violation occurs before the operating system returns from the previous General Protection Fault-interrupt, the processor will signal a Double fault (interrupt vector 8, a typical BSOD scenario.)
If yet another failure occurs, the processor will shut down. It will then only respond to a reset or init (that is, pressing the reset-button, or rebooting the entire system) and NMI-interrupts (unless it has previously failed when handing NMI-interrupts, in which case it will ignore these too.)
