Questions about this topic? Sign up to ask in the talk tab.

Difference between revisions of "Segmentation fault"

From NetSec
Jump to: navigation, search
Line 1: Line 1:
'''Segmentation fault''' (segfault) or '''access violation''' is when an application tries to access a wrong or unauthorized memory location, and its stopped by the [[operating system]], generating an error.
+
'''Segmentation fault''' (segfault) or '''access violation''' is when an application tries to access a wrong or unauthorized [[memory address|memory location]], and its stopped by the operating system, generating an error.
  
  

Revision as of 03:05, 19 October 2011

Segmentation fault (segfault) or access violation is when an application tries to access a wrong or unauthorized memory location, and its stopped by the operating system, generating an error.


Overview

With current operative systems, each process has one or more segments of the system memory which can store and retrieve information. Each process can request more or less memory (as needed), and the request will be recognized by the operating system and compared with the given memory section for the process. Generally, the process that requested memory is the only one who can read or modify it.

A segmentation fault occurs when a process attempts to access a portion of memory allocated into another application, or an unused area of memory, without permission. It usually occurs as a result of a programming error, for example, a pointer astray. Another way to get a "segmentation fault" is a physically broken memory, because a program written to memory would try to access that data, but since it has memory fails, it is possible that the data has been erased, thus the program will consider that memory address as empty, or unused, so it will trigger the error.