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

Document Information

Preface

1.  Introduction

2.  Sun 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

SUNW_DISCOVER_FOLLOW_FORK_MODE 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

ABR

ABW

BFM

BRP

DFM

FMR

FMW

FRP

IMR

IMW

PIR

UAR

UAW

UMR

Memory Access Warnings

AZS

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)

Index

Requirements for Using Discover

Binaries Must Be Prepared Correctly

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

When using a Sun Studio or Oracle Solaris Studio compiler, you must compile with optimizations by using the -O option or the -xO[n] option. When using a GCC compiler, no particular optimization level is required.

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().