Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)

#3 0x70e7ceb8 in memcpy+0x58 () from /opt/langtools/lib/librtc.sl
#4 0x2c54 in main () at string.c:13
#5 0x70ee3478 in _start+0xc0 () from /usr/lib/libc.2
(gdb) c
Continuing.
Program exited normally.
Detecting Out-of-Bounds Writes with the Bounds-Checking Feature
The set heap-check bounds <on/off> command toggles the bounds-checking
feature in WDB. When bounds-checking is enabled, WDB allocates extra space (guard
bytes) at the beginning and end of a block during allocation and fills this space with a
specific pattern. When the blocks are freed, the debugger verifies if the patterns are
intact. If the patterns are corrupted, the debugger detects underflow or overflow errors
and reports the corruption. Example 12 (page 49) illustrates the bounds-checking feature.
The bounds checking feature detects overflow and underflow errors only when the write
operation occurs within the guard bytes.
48