FACTOID # 25: If you're in Montserrat, watch your back! Nearly 1% of the population are police officers.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Segmentation fault
It has been suggested that Access violation be merged into this article or section. (Discuss)

A segmentation fault (often shortened to segfault) is a particular error condition that can occur during the operation of computer software. In short, a segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (e.g., attempts to write to a read-only location, or to overwrite part of the operating system). Systems based on processors like the Motorola 68000 tend to refer to these events as Address or Bus errors. Image File history File links Please see the file description page for further information. ... An access violation is the attempt by a computer process to access a memory area that it does not own or have permission to access. ... A screenshot of computer software in action. ... The Motorola 68000 is a 32 bit CISC microprocessor, the first member of a successful family of microprocessors from Motorola, which were all mostly software compatible. ...


Segmentation is one approach to memory management and protection in the operating system. It has been superseded by paging for most purposes, but much of the terminology of segmentation is still used, "segmentation fault" being an example. Some operating systems still have segmentation at some logical level although paging is used as the main memory management policy. Segmentation is one of the most common ways to achieve memory protection; another common one is paging. ... Memory management is the act of managing computer memory. ... An operating system is a special computer program that manages the relationship between application software, the wide variety of hardware that makes up a computer system, and the user of the system. ... In computer operating systems, paging memory allocation algorithms divide computer memory into small partitions, and allocates memory using a page as the smallest building block. ...


On Unix-like operating systems, a process that accesses invalid memory receives the SIGSEGV signal. On Microsoft Windows, a process that accesses invalid memory receives the STATUS_ACCESS_VIOLATION exception. A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification. ... SIGSEGV is the symbolic name for the signal thrown by computer programs making invalid memory references on POSIX compliant platforms. ... A signal is an asynchronous event transmitted between one process and another. ... Windows redirects here. ...


Example

Here is an example of an ANSI C program that should create a segmentation fault on most platforms with memory protection: ANSI C (Standard C) is a variant of the C programming language. ...

 #include <stdlib.h> int main(void) { char *p = NULL; /* p is now a NULL-pointer of type "char *" */ *p = 'x'; /* Attempt to write character 'x' at address 0 (the NULL-pointer) */ return 0; } 

Compiling and running it on NetBSD produces the following: NetBSD was the second freely redistributable, open source version of the BSD Unix-like computer operating systems to produce a formal release (after 386BSD) and continues to be actively developed. ...

 $ cc -g3 -o segfault segfault.c $ ./segfault Segmentation fault 

Backtrace from gdb: A stack trace (also called backtrace) is a dump of the active stack frames left in memory by the execution of a program. ... The GNU Debugger, usually called just GDB, is the standard debugger for the GNU software system. ...

 Program received signal SIGSEGV, Segmentation fault. 0x080487b0 in main () at segfault.c:4 4 *p = 'x'; (gdb) bt #0 0x080487b0 in main () at segfault.c:4 

Note that the language standard does not say anything about what happens when a null pointer is dereferenced; it invokes undefined behaviour and literally anything might happen (including but not limited to exiting successfully). The conditions under which segmentation violations occur and how they manifest themselves is specific to an operating system. In computer science, to simplify the specification and allow some flexibility in implementation, the specification sometimes defines a behavior undefined. ...


See also


  Results from FactBites:
 
Using Microseismicity and Surface Offset Data to Define Fault Segment Boundaries Along Low Friction Faults (13141 words)
For fault segments with a constant long-term slip rate, accumulated slip deficits must eventually be resolved by failure on the segment along which the deficit has occurred, failure along another structure parallel to the area of the slip deficit, or distributed deformation adjacent to the fault (such as contractional or dilational structures).
The fault segments that ruptured during the 1857 events display microseismic activity that indicate that the fault deepens from ≈ 14 km in the area of Cholame, California, to ≈ 22 km as the fault enters the locked Carrizo Segment of the San Andreas Fault (e.g., Hill, 1990).
We examine the effect of relative fault strength on the surface slip distribution for the fault geometry of the Cholame and Carrizo segments of the SAF that we have inferred from microseismicity.
segmentation fault: Information from Answers.com (460 words)
A segmentation fault (often shortened to segfault) is a particular error condition that can occur during the operation of computer software.
A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system).
Segmentation is one approach to memory management and protection in the operating system.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.