In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
a storage violation is a hardware or software
fault that occurs when a
task attempts to access an area of
computer storage
Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers.
The central processing unit (CPU) of a comput ...
which it is not permitted to access.
Types of storage violation
Storage violation can, for instance, consist of reading from, writing to, or freeing storage not owned by the task. A common type of storage violation is known as a
stack buffer overflow
In software, a stack buffer overflow or stack buffer overrun occurs when a program writes to a memory address on the program's call stack outside of the intended data structure, which is usually a fixed-length buffer.
Stack buffer overflow bugs ...
where a program attempts to exceed the limits set for its
call stack
In computer science, a call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, program stack, control stack, run-time stack, or mach ...
. It can also refer to attempted modification of memory "owned" by another thread where there is incomplete (or no) memory protection.
Avoidance of storage violations
Storage violations can occur in transaction systems such as
CICS in circumstances where it is possible to write to storage not owned by the transaction; such violations can be reduced by enabling features such as
storage protection
Memory protection is a way to control memory access rights on a computer, and is a part of most modern instruction set architectures and operating systems. The main purpose of memory protection is to prevent a process from accessing memory that ...
and
transaction isolation.
Detection of storage violations
Storage violations can be difficult to detect as a program can often run for a period of time after the violation before it crashes. For example, a pointer to a freed area of memory can be retained and later reused causing an error. As a result, efforts focus on detecting violations as they occur, rather than later when the problem is observed.
In systems such as CICS, storage violations are sometimes detected (by the CICS
kernel
Kernel may refer to:
Computing
* Kernel (operating system), the central component of most operating systems
* Kernel (image processing), a matrix used for image convolution
* Compute kernel, in GPGPU programming
* Kernel method, in machine lea ...
) by the use of "signatures", which can be tested to see if they have been overlaid.
An alternative runtime library may be used to better detect storage violations, at the cost of additional overhead.
Some programming languages use software
bounds checking
In computer programming, bounds checking is any method of detecting whether a variable is within some bounds before it is used. It is usually used to ensure that a number fits into a given type (range checking), or that a variable being used as ...
to prevent these occurrences.
Some program
debugging
In computer programming and software development, debugging is the process of finding and resolving ''bugs'' (defects or problems that prevent correct operation) within computer programs, software, or systems.
Debugging tactics can involve in ...
software will also detect violations during testing.
Common causes
*A runaway subscript leading to illegal use of reference modification during run time.
*Linkage layout mismatch between called and the calling elements.
*Use of previously freed (and sometimes already re-allocated) memory.
Examples of software detecting storage violations
*
Intertest originally from Online Software International, later
Computer Associates
CA Technologies, formerly known as CA, Inc. and Computer Associates International, Inc., is an American multinational corporation headquartered in New York City. It is primarily known for its business-to-business (B2B) software with a product p ...
See also
*
Segmentation fault
In computing, a segmentation fault (often shortened to segfault) or access violation is a fault, or failure condition, raised by hardware with memory protection, notifying an operating system (OS) the software has attempted to access a restrict ...
References
*
CICS problem determination Guide
External links
*https://plus.google.com/u/1/collection/wUwasB Marketing material for other product detecting storage violations
Computer memory
Memory management
{{compsci-stub