Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Memory corruption
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Multiple issues| {{refimprove|date=May 2016}} {{Original research|date=June 2020}} }} {{Program execution}} '''Memory corruption''' occurs in a [[computer program]] when the contents of a [[Memory address|memory location]] are modified due to programmatic behavior that exceeds the intention of the original [[programmer]] or program/language constructs; this is termed as violation of [[memory safety]]. The most likely causes of memory corruption are [[Software bug|programming errors]] (software bugs). When the corrupted memory contents are used later in that 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 (memory management)|heap]] corruption.<ref name="verifier">{{Cite web|last=Radich|first=Q.|last2=Sherer|first2=T.|last3=Sharkey|first3=K.|last4=Batchelor|first4=D.|last5=Kennedy|first5=J. T.|last6=Mabee|first6=D.|last7=Coulter|first7=D.|last8=Michael|first8=S.|date=28 April 2021|title=Application Verifier (Windows 7 and Windows Server 2008 R2 Application Quality Cookbook) - Win32 apps|publisher=Microsoft Developer Network|url=https://docs.microsoft.com/en-us/windows/win32/win7appqual/application-verifier|access-date=2022-02-09|language=en-us}}</ref> Modern programming languages like [[C (programming language)|C]] and [[C++]] have powerful features of explicit memory management and [[Pointer (computer programming)|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, for two reasons: #The source of the memory corruption and its manifestation may be far apart, making it hard to correlate the cause and the effect. #Symptoms appear under unusual conditions, making it hard to consistently reproduce the error. Memory corruption errors can be broadly classified into four categories: #Using [[uninitialized variable|uninitialized memory]]: Contents of uninitialized memory are treated as garbage values. Using such values can lead to unpredictable program behavior. #Using non-owned memory: It is common to use pointers to access and modify memory. If such a pointer is a null pointer, [[dangling pointer]] (pointing to memory that has already been freed), or to a memory location outside of current stack or [[Heap (memory management)|heap]] bounds, it is referring to memory that is not then possessed by the program. Using such pointers is a serious programming flaw. Accessing such memory usually causes operating system exceptions, that most commonly lead to a program crash (unless suitable memory protection software is being used). #Using memory beyond the memory that was allocated ([[buffer overflow]]): If an array is used in a loop, with incorrect terminating condition, memory beyond the array bounds may be accidentally 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. In some cases programs can also incorrectly access the memory before the start of a buffer. #Faulty heap memory management: [[Memory leak]]s and freeing non-heap or un-allocated memory are the most frequent errors caused by faulty heap memory management. Many [[memory debugger]]s such as [[Purify (software)|Purify]], [[Valgrind]], [[Insure++]], [[Parasoft C/C++test]], [[AddressSanitizer]] are available to detect memory corruption errors. == See also == *[[Storage violation]] == References == <references /> ==External links== * [https://www.proggen.org/doku.php?id=security:memory-corruption:start Memory Corruption Tutorial] An introduction to exploitation techniques and protection mechanisms [[Category:Software bugs]] [[Category:Computer memory]] [[Category:Computer security exploits]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:Multiple issues
(
edit
)
Template:Program execution
(
edit
)