Memory corruption

Memory corruption

Memory corruption happens when the contents of a memory location are unintentionally modified due to programming errors; this is known as violating memory safety. When the corrupted memory contents are used later in the computer program, it leads either to program crash or to strange and bizarre program behavior. Nearly 10% of application crashes on Windows systems are due to heap corruption.[1]

Modern programming languages like C and C++ have powerful features of explicit memory management and pointer arithmetic. These features are designed for developing efficient applications and system software. However, using these features incorrectly may lead to memory corruption errors.

Memory corruption is one of the most intractable class of programming errors because of two reasons:

  1. The source of the memory corruption and its manifestation may be far apart making it hard to correlate the cause and the effect.
  2. Symptoms appear under unusual conditions, making it hard to consistently reproduce the error.

Memory corruption errors can be broadly classified into four categories:

  1. Using un-initialized memory: Contents of un-initialized memory are considered to be garbage values and using these values can lead to unpredictable program behavior.
  2. Using un-owned memory: It is common to use pointers for accessing and modifying memory. If a pointer happens to be a null pointer, dangling pointer (pointing to memory that has already been freed), or to a memory location outside of current stack or heap bounds, it is referring to memory that is not currently possessed by the program. And using such pointer is a serious programming flaw. Accessing such memory usually causes operating system exceptions (also known as page faults) which most commonly lead to a program crash. However, it has been proved that such erroneous accesses can also lead to better executions, one mistake correcting another.[citation needed]
  3. Using beyond allocated memory (buffer overflow): If an array is used in a loop, with incorrect terminating condition, memory beyond the array bounds may be manipulated. Buffer overflow is one of the most common programming flaws exploited by computer viruses causing serious computer security issues (e.g. Return-to-libc attack, Stack-smashing protection) in widely used programs. One can also incorrectly access the memory before the beginning of a buffer.
  4. Faulty heap memory management: Memory leaks and freeing non-heap or un-allocated memory are the most frequent errors caused by faulty heap memory management.

Many memory debuggers such as Purify, Valgrind, Insure++ are available for detecting memory corruption errors.

References

  1. ^ "Application Verifier". MSDN Library. Microsoft. 19 April 2011. http://msdn.microsoft.com/en-us/library/dd371695%28v=vs.85%29.aspx. Retrieved 4 May 2011. 

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Remote Direct Memory Access — (RDMA) allows data to move directly from the memory of one computer into that of another without involving either one s operating system. This permits high throughput, low latency networking, which is especially useful in massively parallel… …   Wikipedia

  • Phase-change memory — Computer memory types Volatile RAM DRAM (e.g., DDR SDRAM) SRAM In development T RAM Z RAM TTRAM Historical Delay line memory Selectron tube Williams tube Non volatile …   Wikipedia

  • Data corruption — Photo data corruption; in this case, a result of a failed data recovery from a hard disk drive Data corruption refers to errors in computer data that occur during writing, reading, storage, transmission, or processing, which introduce unintended… …   Wikipedia

  • Delay line memory — Computer memory types Volatile RAM DRAM (e.g., DDR SDRAM) SRAM In development T RAM Z RAM TTRAM Historical Delay line memory Selectron tube Williams tube …   Wikipedia

  • Manual memory management — In computer science, manual memory management refers to the usage of manual instructions by the programmer to identify and deallocate unused objects, or garbage. Up until the mid 1990s, the majority of programming languages used in industry… …   Wikipedia

  • DriveSpace — Doublespace redirects here. For other uses, see Doublespace (disambiguation). DriveSpace (initially known as DoubleSpace) is a disk compression utility supplied with MS DOS starting from version 6.0. The purpose of DriveSpace is to increase the… …   Wikipedia

  • PaX — In computer security, PaX is a patch for the Linux kernel that implements least privilege protections for memory pages. The least privilege approach allows computer programs to do only what they have to do in order to be able to execute properly …   Wikipedia

  • Nokia 770 Internet Tablet — Manufacturer Nokia Retail availability 2005 11 03 Media RS MMC or MMCmobile …   Wikipedia

  • Chromium (web browser) — Chromium Chromium 13.0 …   Wikipedia

  • Spirit rover — (MER A) Artist s concept of Rover on Mars Operator NASA Mission type Rover Launch date …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”