Array Bounds Errors (Error Detection)

Related Topics

When a program writes memory past the boundary of an allocated block, the memory it writes into could overwrite and corrupt another data structure. Without Purify, this type of error is usually discovered much later in the run, when the corrupted memory comes into use.

Reading from beyond the memory block might appear less critical because memory is not corrupted. However, the behavior of the program comes to depend upon the values accessed, which are unpredictable. If the layout of memory is changed, the memory block adjacent to the block for which the reference was intended might be totally different and contain different values. A program that reads beyond block boundaries and apparently works correctly is relying upon accidental circumstances. Some remote and unrelated change in the program, environment, or data could change those circumstances and cause the program to fail mysteriously.

Purify intercepts all calls to dynamic memory allocation functions and reports an Array Bounds Read (ABR) or an Array Bounds Write (ABW) message. If you use minimal instrumentation, Purify can report a Late Detect Array Bounds Write (ABWL) message.

To find out more about correcting memory access errors, click images\shortcut.gif

(C) Copyright IBM Corporation 1992, 2010.