General Protection Fault - Memory Errors

Memory Errors

In memory errors, the faulting program accesses memory that it should not access. Examples include:

  • Attempting to write to a read-only portion of memory
  • Attempting to execute bytes in memory which are not designated as instructions
  • Attempting to read as data bytes in memory which are designated as instructions
  • Other miscellaneous conflicts between the designation of a part of memory and its use

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.

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.

Read more about this topic:  General Protection Fault

Famous quotes containing the words memory and/or errors:

    Canst thou not minister to a mind diseased,
    Pluck from the memory a rooted sorrow,
    Raze out the written troubles of the brain,
    And with some sweet oblivious antidote
    Cleanse the fraught bosom of that perilous stuff
    Which weighs upon the heart?
    William Shakespeare (1564–1616)

    Truth has not single victories; all things are its organs,—not only dust and stones, but errors and lies.
    Ralph Waldo Emerson (1803–1882)