Oracle® Solaris Studio 12.4: Discover and Uncover User's Guide

Exit Print View

Updated: December 2015
 
 

Requirements for Using discover

This section describes requirements for using discover and achieving the best results and contains the following topics:

Prepare Binaries Correctly

The discover utility works on binaries compiled with Sun Studio 12 Update 1, Oracle Solaris Studio 12.2, Oracle Solaris Studio 12.3, or Oracle Solaris Studio 12.4 compilers. It works on a SPARC–based or x86–based system running at least the Solaris 10 10/08 operating system at least Oracle Solaris 11, Oracle Enterprise Linux 5.x, or Oracle Enterprise Linux 6.x.

The discover utility 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 use the –l option to detect a limited number of errors. See Instrumentation Options.

A compiled binary 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.

Use the –g option to generate debug information when compiling the binary so discover can display source code and line number information while reporting errors and warnings, and 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. While discover can work with many optimized binaries, the use of –g is still recommended. For more information, see Interpreting discover Error Messages.

For best results, binaries should be compiled with no optimization options and with the –g option. Optimized code can vary from the source code due to optimizations, such as use of same memory locations for different variables and generation of speculative code. Using advanced optimization options while compiling can cause discover to report incorrect errors or to not report errors.


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

For more information, see Limitations When Using discover

Binaries That Use Preloading or Auditing Are Incompatible

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 will not 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 because 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.