Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Specific behavior  



1.1  Microsoft Windows  





1.2  Unix  







2 Memory errors  





3 Privilege errors  





4 Technical causes for faults  



4.1  Segment limits exceeded  





4.2  Segment permissions violated  





4.3  Segments illegally loaded  





4.4  Switching  





4.5  Miscellaneous  







5 References  





6 Further reading  














General protection fault






Azərbaycanca
Català
Deutsch

Bahasa Indonesia
Polski
Português

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Error message in a white dialog box stating "UNRECOVERABLE APPLICATION ERROR: Terminating current application."
Generic error message for a general protection fault (Unrecoverable Application Error) in Windows 3.0
Error message for a general protection fault in Windows 3.1x
Example error message for a general protection fault in Windows 3.1x

Ageneral 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. The mechanism is first described in Intel manuals and datasheets for the Intel 80286 CPU, which was introduced in 1983; it is also described in section 9.8.13 in the Intel 80386 programmer's reference manual from 1986. A general protection fault is implemented as an interrupt (vector number 13 (0Dh)). Some operating systems may also classify some exceptions not related to access violations, such as illegal opcode exceptions, as general protection faults, even though they have nothing to do with memory protection. If a CPU detects a protection violation, it stops executing the code and sends a GPF interrupt. In most cases, the operating system removes the failing process from the execution queue, signals the user, and continues executing other processes. 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 GPF interrupt, the CPU signals a double fault, stopping the operating system. If yet another failure (triple fault) occurs, the CPU is unable to recover; since 80286, the CPU enters a special halt state called "Shutdown", which can only be exited through a hardware reset. 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. All descendants of the PC AT do the same, so in a PC, a triple fault causes an immediate system reset.

Specific behavior[edit]

Microsoft Windows[edit]

InMicrosoft Windows, the general protection fault presents with varied language, depending on product version:

Operating system Error message Notes
Windows 3.0 UNRECOVERABLE APPLICATION ERROR

Terminating current application.

[1]
Windows 3.1x [Program Name] caused a General Protection Fault in module [module name] at [memory address]. This error message (with the same design format) can also appear in later versions (95, 98 and Me) in rare occasions. The text of this error also appears in 95, 98 and Me if the 'Details' button is clicked or if Alt+D is pressed, with the addition of Registers, Bytes at CS:EIP and Stack Dump.
Windows 95
Windows 98
Windows NT 4.0
This program has performed an illegal operation and will be shut down.

If the problem persists, contact the program vendor.

Sometimes, the error also says, "Quit all programs, and then restart your computer", especially when the problem is more severe or when the system is unstable, and the return address points into a Windows DLL or other system processes. When a debugger is installed, there is also a Debug button between the Close and Details buttons.
Windows 2000 [Program Name] has generated errors and will be closed by Windows. You will need to restart the program.

An error log is being created.

Windows Me [Program Name] has caused an error in [Module Name]. [Program Name] will now close.

If you continue to experience problems, try restarting your computer.

When a debugger is installed, there is also a Debug button below the Close button. Details are still viewable by pressing Alt+D and via the faultlog.txt file.
Windows XP
Windows Server 2003
Windows Server 2003 R2
[Program Name] has encountered a problem and needs to close. We are sorry for the inconvenience.

If you were in the middle of something, the information you were working on might be lost.

[...]

For more information about this error, click here.

The error message also offers the option to send error details to Microsoft for analysis.
Windows Vista and later, excluding Windows 10
Windows Server 2008 and later
[Program Name] has stopped working.

A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.

By default, Windows will send error details to Microsoft for analysis but the system can be configured to either not send, or ask the user what to do each time.
Windows 10
Windows 11
Windows will send error details to Microsoft for analysis. Users with a business license can configure how much information is sent.

In Windows 95, 98 and Me, there is an alternate error message, used mostly with Windows 3.x programs: "An error has occurred in your program. To keep working anyway, click Ignore and save your work in a new file. To quit this program, click Close. You will lose information you entered since your last save." Clicking "Close" results in one of the error messages above, depending on Windows version. "Ignore" sometimes does this too.

Unix[edit]

InLinux and other Unices, the errors are reported separately (e.g. segmentation fault for memory errors).

Memory errors[edit]

In memory errors, the faulting program accesses memory that it should not access. 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.

In terms of the x86 architecture, general protection faults are specific to segmentation-based protection when it comes to memory accesses. However, general protection faults are still used to report other protection violations (aside from memory access violations) when paging is used, such as the use of instructions not accessible from the current privilege level (CPL).

While it is theoretically possible for an operating system to utilize both paging and segmentation, for the most part, common operating systems typically rely on paging for the bulk of their memory access control needs.

Privilege errors[edit]

There are some things on a computer which are reserved for the exclusive use of the operating system. 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.

Additionally, there are storage locations which are reserved both for the operating system and the processor itself. 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.

Technical causes for faults[edit]

General protection faults are raised by the processor when a protected instruction is encountered which exceeds the permission level of the currently executing task, either because a user-mode program is attempting a protected instruction, or because the operating system has issued a request which would put the processor into an undefined state.

General protection faults are caught and handled by modern operating systems. Generally, if the fault originated in a user-mode program, the user-mode program is terminated. If, however, the fault originated in a core system driver or the operating system itself, the operating system usually saves diagnostic information either to a file or to the screen and stops operating. It either restarts the computer or displays an error screen, such as a Blue Screen of Deathorkernel panic.

Segment limits exceeded[edit]

Segment limits can be exceeded:

Segment permissions violated[edit]

Segment permissions can be violated by:

Segments illegally loaded[edit]

This can occur when:

Switching[edit]

Faults can occur in the task state segment (TSS) structure when:

Miscellaneous[edit]

Other causes of general protection faults are:

References[edit]

  1. ^ "Troubleshooting "Unrecoverable Application Error" in DrWatson". Support. Microsoft. 27 February 2014.
  • ^ "Page 223". Retrieved 2023-09-24.
  • Further reading[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=General_protection_fault&oldid=1225980891"

    Categories: 
    Operating system technology
    Computer errors
    Hidden categories: 
    Wikipedia articles that are too technical from June 2015
    All articles that are too technical
    Articles needing additional references from January 2017
    All articles needing additional references
    Articles with multiple maintenance issues
    Wikipedia articles needing clarification from May 2017
     



    This page was last edited on 27 May 2024, at 21:54 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki