Sun Studio 12: Thread Analyzer User's Guide

B.1 FAQ

Question:

Why is the line-number information incorrect?

Answer:

Try turning off optimization or specifying level -x03 or lower. The compiler's optimization transformations can distort line number information and make the experiment result difficult to read.

Question:

Do I really need to install the patches that the collect command is complaining about?

Answer:

Yes. make sure the experiment system has all the required patches installed. Experiment results may be incorrect if any required patches are missing.

Question:

Is it alright to link archive versions of malloc() libraries with my code?

Answer:

No. The Thread Analyzer interposes on malloc() routines so linking archive versions of malloc() libraries can result in false-positive data races.

Question:

Can the Thread Analyzer detect data-races in OpenMP applications? What about POSIX or Solaris thread applications?

Answer:

The Thread Analyzer can detect data-races that occur in code that is written using the POSIX thread API, the Solaris Operating System(R) thread API, OpenMP directives, Sun parallel directives, Cray(R) parallel directives, or a mix of these.

Question:

Can the Thread Analyzer detect data-races between different processes?

Answer:

Not yet. It currently only detects data-races between different threads spawned from a single process.

Question:

Is the Thread Analyzer able to find all data-races?

Answer:

No. The Thread Analyzer detects data-races at run time and the exact runtime behavior of an application depends on the set of input data. A given input-data set may not lead to a data-race. The Thread Analyzer models the concurrency between threads at a high level in order to minimize the impact of scheduling by the operating system. However, the operating system scheduling can still affect memory allocation and storage reuse which changes the potential for data-races.

Use the Thread Analyzer with different numbers of threads and with different input data-sets and repeat experiments with a single data set to maximize the tool's chance of detecting data-races.

Question:

Why does the Thread Analyzer give me different data-race results in different runs?

Answer:

This occurs because of timing differences between runs. As the threads access memory in a different order from run to run, different data-race results will be reported.

Question:

Why does the Thread Analyzer report data-races that do not exist in my application? How do I remove them?

Answer:

In some cases, the Thread Analyzer may report data-races that never actually occur in the program. These are called false positives, which usually happen when a user-implemented synchronization is used or when memory is recycled between threads. For example, if your code includes hand-coded assembly that implements spin locks, the Thread Analyzer will not recognize these synchronization points. See the tutorial for a detailed description of false positives and examples of how to remove them through API calls.

Question:

What is librdthooks.so and what does it do?

Answer:

librdthooks.so is a library that satisfies the entry points for the data-race-detection instrumentation calls and user API calls. It is linked automatically when a program is compiled and linked with -xinstrument=datarace. See the librdthooks(3) man page for more information.

Question:

How do I know whether an executable or a library has been instrumented?

Answer:

Use nm. See the nm(1) man page for more details. If you find a global undefined symbol of either __rdt_src_read or __rdt_src_write, then the executable or library is instrumented.

Question:

Can I use the Analyzer to read data-race experiments?

Answer:

Yes, the Analyzer displays all of the traditional performance analysis tabs as well as the new Races, Race Source, and Race Detail tabs. The Thread Analyzer interface is streamlined and does not display the traditional Analyzer tabs.

Question:

Why do I get an error message saying that the compiler option -xinstrument=datarace is wrong when I use it with C, C++ or F90?

Answer:

You are using an older version of Sun Studio that does not support the Thread Analyzer. Check the version of Sun Studio that you are using by entering: cc -Version. You must use a version that is no older than June 2006.

Question:

Why do I get an error message when I use the er_print utility which says the races command is invalid?

Answer:

You are using an older version of Sun Studio that does not support the Thread Analyzer. Check the version of Sun Studio that you are using by entering: er_print -V. You must use a version that is no older then June 2006.

Question:

Why do I get an error message saying that -r is not recognized when I run collect -r on?

Answer:

You are using an older version of Sun Studio that does not support the Thread Analyzer. Check the version of Sun Studio that you are using by entering collect -V. You must use a version that is no older then June 2006.

Question:

How do I report a bug or share my Thread Analyzer experience with others?

Answer:

The best resource for sharing your feedback with the Thread Analyzer engineers and users is by reading and posting to the Sun Studio Tools forum. You may find that your question has already been answered.