Networking, Programming and Graphics - Tutorials
ONLINEHOWTO.net Tutorials Category

Segmentation Fault

Type: Terms
Networking, Programming and Graphics - Tutorials
Level: Beginner Networking, Programming and Graphics - Tutorials 
Networking, Programming and Graphics - Tutorials
Date: 2008-Aug-31
Networking, Programming and Graphics - Tutorials
Visited: 1956 times
Networking, Programming and Graphics - Tutorials
Rating: Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Published: Stephen Think

One of the most common problems when making software is errors like "Segmentation fault" , also called SegFault. Here is what a SegFault is.
Virtual memory in a computer can be created in 2 ways: pages or segments. Paging means that the memory is divided in pages of equal size, containing words of memory in it. Segmentation means that every process has a segment of memory of needed size, with gaps of empty memory blocks between the segments. The operating system knows the upper limit of every segment, and every segment begins at a virtual address 0. When a program accesses a memory block, it calls a virtual address that the Memory Management Unit (MMU) maps to a real address. If the operating system sees that the requested address doesn't match any valid address in the segment, it will send a signal to the process terminating it.
Segmentation Fault
SegFaults are the direct result of a memory error. The program has a bad pointer, a memory leak or any kind
of error that makes it access the wrong memory address. To correct these errors you need to check pointers
and arrays for errors.
Segmentation Fault
Segmentation fault errors are also the one most hard to troubleshoot with a third party software.
If not the only way, it is most commonly to use a system debugger program for identifying what cause such kind of software crashes. The most useful tools are gdb (GNU debugger) and strace.
No matter that these utilities will show you information which library causes the unauthorized memory access further steps for fixing such error most of the time requires that you contact the vendor of the application directly. Of course if it comes to open source software it is highly recommended to check the mailing lists first.
Segmentation Fault
Rate this tutorial:                    
Post Comment

    • ( sailajavani7 [ at ] gmail . com ),

      posted on 2010-Apr-11 | 10:43:23 PM
      i clearly undstnd this topic
      thanqq
Need a specific tutorial? Do not hesitate and submit a request!
Your e-mail: