Debugging Dynamic Memory Usage Errors Using NonStop Native Inspect White Paper

Introduction
HP NonStop Debugger (Native Inspect) is an HP-supported implementation of the open source
debugger GDB. In addition to the normal debugging functions, it also enables you to debug
memory-related errors in a program.
Native Inspect supports memory-debugging (using Run Time Checking (RTC)) of source-level
programs written in HP NonStop C and HP NonStop C++ on Itanium®-based systems running the
NonStop Guardian or OSS operating systems.
Native Inspect offers the following memory-debugging capabilities:
Reports memory leaks.
Reports heap allocation profiles.
Stops program execution if bad writes occur with string operations such as strcpy(),and
memcpy().
Stops program execution when freeing unallocated or deallocated blocks.
Stops program execution when freeing a block if bad writes occur outside block boundary.
Stops program execution conditionally based on whether a specified block address is allocated
or de-allocated.
Intended Audience
This document is intended for C and C++ programmers who use NonStop Native Inspect debugger
to detect and debug memory-related errors. The reader of this document must be familiar with the
basic commands supported by Native Inspect.
Typographic Conventions
This document uses the following typographical conventions:
A colon represents the system prompt for OSS.:
A right arrow represents a prompt in TACL on Guardian.>
A command name or qualified command phrase.Command
Text displayed by the computer.Computer output
The name of an environment variable, for example,PATH.ENVIRONMENT VARIABLE
The name of an error, usually returned in the
errnovariable.
[ERROR NAME]
The name of a placeholder in a command, function, or
other syntax display that you replace with an actual value.
Variable
The contents are optional in syntax. If the contents are a
list separated by |,you must choose one of the items.
< >
Separates items in a list of choices.|
This alert provides essential information to explain a
concept or to complete a task.
IMPORTANT
A note contains additional information to emphasize or
supplement important points of the main text.
NOTE
Related Information
The NonStop C runtime library defines several functions useful in detecting memory-related problems.
These functions are not part of the memory leak detection functionality in the debugger. The function
4