JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: Discover and Uncover User's Guide     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information


1.  Introduction

2.  Memory Error Discovery Tool (Discover)

Requirements for Using Discover

Binaries Must Be Prepared Correctly

Binaries That Use Preloading or Auditing Cannot Be Used

Binaries That Redefine Standard Memory Allocation Functions Can Be Used

Quick Start

Instrumenting a Prepared Binary

Caching Shared Libraries

Instrumenting Shared Libraries

Ignoring Libraries

Command Line Options

Output Options

Instrumentation Options

Caching Options

Other Options

bit.rc Initialization Files

SUNW_DISCOVER_OPTIONS Environment Variable


Running an Instrumented Binary

Analyzing Discover Reports

Analyzing the HTML Report

Using the Errors Tab

Using the Warnings Tab

Using the Memory Leaks Tab

Using the Control Panel

Analyzing the ASCII Report

Memory Access Errors and Warnings

Memory Access Errors


















Memory Access Warnings


Interpreting Discover Error Messages

Partially Initialized Memory

Speculative Loads

Uninstrumented Code

Limitations When Using Discover

Only Annotated Code is Instrumented

Machine Instruction Might Differ From Source Code

Compiler Options Affect the Generated Code

System Libraries Can Affect the Errors Reported

Custom Memory Management Can Affect the Accuracy of the Data

Out of Bounds Errors for Static and Automatic Arrays Cannot Be Detected

3.  Code Coverage Tool (Uncover)


Requirements for Using Discover

Binaries Must Be Prepared Correctly

Discover works on binaries compiled with the Sun Studio 12 Update 1, Oracle Solaris Studio 12.2, or Oracle Solaris Studio 12.3 compilers; or the GCC for Sun Systems compilers starting with version 4.2.0. It works on a SPARC-based or x86-based system running the Solaris 10 10/08 operating system or a later Solaris 10 update, or Oracle Solaris 11.

Discover issues an error and does not instrument a binary if it does not meet these requirements. However, you can instrument a binary that does not meet these requirements and run it to detect a limited number of errors by using the -l option (see Instrumentation Options).

A binary compiled as described includes information called annotations to help Discover instrument it correctly. The addition of this small amount of information does not affect the performance of the binary or its runtime memory usage.

Using the -g option to generate debug information when compiling the binary allows Discover to display source code and line number information while reporting errors and warnings, and to produce more accurate results. If your binary is not compiled with the -g option, Discover displays only the program counters of the corresponding machine level instructions. Also, compiling with the -g option helps Discover produce more accurate reports (see Interpreting Discover Error Messages.

Binaries That Use Preloading or Auditing Cannot Be Used

Because Discover uses some special features of the runtime linker, you cannot use it with binaries that use preloading or auditing.

If a program requires the setting of the LD_PRELOAD environment variable, it probably won't work correctly with Discover, because Discover needs to interpose on certain system functions, and it cannot do so if the function has been preloaded.

Similarly, if a program uses runtime auditing (either the binary was linked with the -p option or the -P option, or it requires the LD_AUDIT environment variable to be set), this auditing will conflict with Discover's use of auditing. If the binary was linked with auditing, Discover fails at instrumentation time. If you set the LD_AUDIT environment variable at runtime, the results are undefined.

Binaries That Redefine Standard Memory Allocation Functions Can Be Used

Discover supports binaries that redefine the standard memory allocation functions: malloc(), calloc(), memalign(), valloc(), and free().