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

Preface

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

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

OLP

PIR

SBR

SBW

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

Quick Start

The following is an example of preparing a program, instrumenting it with Discover, and then running it and producing a report on the detected memory access errors. This example uses a simple program that accesses uninitialized data.

% cat test_UMR.c
#include <stdio.h>
#include <stdlib.h>
int main()
{
  //  UMR:  accessing uninitialized data 
  int *p = (int*) malloc(sizeof(int));
  printf("*p = %d\n", *p);
  free(p);
}

% cc -g -02 test_UMR.c
% a.out
*p = 131464
% discover a.out
% a.out 

The Discover output shows where the uninitialized memory was used and where it was allocated, along with summary of results.

image:HTML report