Double fault
Encyclopedia
On the x86 architecture, a double fault exception occurs if the processor
encounters a problem while trying to service a pending interrupt
or exception
. An example situation when a double fault would occur is when an interrupt is triggered but the segment in which the interrupt handler
resides is invalid. If the processor encounters a problem when calling the double fault handler, a triple fault
is generated and the processor shuts down.
As double faults can only happen due to kernel
bugs, they are rarely caused by userland programs in a modern protected mode
operating system
, unless the program somehow gains kernel access (some viruses and also some low-level DOS
programs). Other processors like PowerPC
or SPARC
generally save state to predefined and reserved machine registers. A double fault will then be a situation where another exception happens while the processor is still using the contents of these registers to process the exception. SPARC processors have four levels of such registers, i.e. they have a 4-window register system
.
Central processing unit
The central processing unit is the portion of a computer system that carries out the instructions of a computer program, to perform the basic arithmetical, logical, and input/output operations of the system. The CPU plays a role somewhat analogous to the brain in the computer. The term has been in...
encounters a problem while trying to service a pending interrupt
Interrupt
In computing, an interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution....
or exception
Exception handling
Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution....
. An example situation when a double fault would occur is when an interrupt is triggered but the segment in which the interrupt handler
Interrupt handler
An interrupt handler, also known as an interrupt service routine , is a callback subroutine in microcontroller firmware, operating system or device driver whose execution is triggered by the reception of an interrupt...
resides is invalid. If the processor encounters a problem when calling the double fault handler, a triple fault
Triple fault
A triple fault is a special kind of exception generated by the CPU when an exception occurs while the CPU is trying to invoke the double fault exception handler, which itself handles exceptions occurring while trying to invoke a regular exception handler....
is generated and the processor shuts down.
As double faults can only happen due to kernel
Kernel (computing)
In computing, the kernel is the main component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources...
bugs, they are rarely caused by userland programs in a modern protected mode
Protected mode
In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units...
operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
, unless the program somehow gains kernel access (some viruses and also some low-level DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
programs). Other processors like PowerPC
PowerPC
PowerPC is a RISC architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM...
or SPARC
SPARC
SPARC is a RISC instruction set architecture developed by Sun Microsystems and introduced in mid-1987....
generally save state to predefined and reserved machine registers. A double fault will then be a situation where another exception happens while the processor is still using the contents of these registers to process the exception. SPARC processors have four levels of such registers, i.e. they have a 4-window register system
Register window
In computer engineering, the use of register windows is a technique to improve the performance of a particularly common operation, the procedure call...
.