Sun Java Solaris Communities My SDN Account Join SDN
 
Downloads

Sun Studio Express - Data Race Detection Tool FAQ

 

Contents

  1. What is the Data Race Detection Tool (DRDT) and who should use it?
  2. Is DRDT available for both the SPARC and x86 platforms?
  3. Where are the man pages and other docs for this release?
  4. Can DRDT detect data-races in OpenMP applications? What about POSIX or Solaris thread applications?
  5. Can DRDT detect data-races between different processes?
  6. Is DRDT able to find all data-races?
  7. Why does DRDT give me different data-race results in different runs?
  8. Why does DRDT report data-races that do not exist in my application? How do I remove them?
  9. What is librdthooks.so and what does it do?
  10. Why does only one access of a data-race show a full call stack?
  11. How do I know whether an executable or a library has been instrumented?
  12. Can I use the Analyzer to read data-race experiment results?
  13. Why do I get an error message saying that the compiler option -xinstrument=datarace is wrong when I use it with cc/CC/f90?
  14. Why do I get an error message when I use the er_print utility which says the races command is invalid?
  15. Why do I get an error message saying that -r is not recognized when I run collect -r on?
  16. How do I report a bug or share my DRDT experience with others?

  1. What is the Data Race Detection Tool (DRDT) and who should use it?
  2. DRDT detects data-races that occur during the execution of a multi-threaded process. A data race occurs when two or more threads in a process access the same memory location concurrently, at least one of the accesses is for writing, and the threads are not using any exclusive locks to control their accesses to that memory.

    A data race may result in non-deterministic program behavior and incorrect execution. Bugs caused by data races are notoriously difficult to detect by hand. DRDT keeps track of data accesses in a multi-threaded program at runtime, and reports data races that have been encountered. By automatically detecting data races, the tool relieves the programmer from the laborious task of debugging the program and eases the task of multi-threaded programming.

  3. Is DRDT available for both the SPARC and x86 platforms?
  4. DRDT supports the following hardware and operating systems:

    • The SPARC(R) v8plus, v8plusa, v8plusb, v9, v9a, and v9b architectures
    • The Intel(R) x86 and AMD(R) x64 platforms
    • The Solaris 9 and Solaris 10 operating systems

  5. Where are the man pages and other docs for this release?
  6. A Getting Started Guide, and a tutorial on Using DRDT have been prepared for this preliminary release. There is also a general DRDT Information Page

    The man pages in the binary Sun Studio Express release have not been updated, and are the man pages for the Sun Studio 11 release. The following man pages have been created or updated specifically for this preliminary release of DRDT:


  7. Can DRDT detect data-races in OpenMP applications? What about POSIX or Solaris thread applications?
  8. DRDT 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.

  9. Can DRDT detect data-races between different processes?
  10. Not yet. DRDT currently only detects data-races between different threads spawned from a single process.

  11. Is DRDT able to find all data-races?
  12. No. DRDT detects data-races at run time and the exact run-time behavior of an application depends on the set of input data. A given input-data set may not lead to a data-race. DRDT 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 DRDT 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.

  13. Why does DRDT give me different data-race results in different runs?
  14. 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.

  15. Why does DRDT report data-races that do not exist in my application? How do I remove them?
  16. In some cases, DRDT 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, DRDT will not recognize these synchronization points. Please see the tutorial on using DRDT for a detailed description of false positives and examples of how to remove them through user API calls.

  17. What is librdthooks.so and what does it do?
  18. 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.

  19. Why does only one access of a data-race show a full call stack?
  20. This is a known limitation of the current Express build. 

  21. How do I know whether an executable or a library has been instrumented?
  22. 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.

  23. Can I use the Analyzer to read data-race experiments?
  24. Yes, though the Analyzer displays all of the traditional performance analysis tabs as well as the new Races, Race Source, and Race Detail tabs. The rdt interface is streamlined for data-race detection and does not display the traditional Analyzer tabs.

  25. Why do I get an error message saying that the compiler option -xinstrument=datarace is wrong when I use it with cc/CC/f90?
  26. You are using an older version of Sun Studio that does not support DRDT. Check the version of Sun Studio that you are using by typing: cc -Version
    The version date displayed should be June 2006 or later.

  27. Why do I get an error message when I use the er_print utility which says the races command is invalid?
  28. You are using an older version of Sun Studio that does not support DRDT. 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.

  29. Why do I get an error message saying that -r is not recognized when I run collect -r on?
  30. You are using an older version of Sun Studio that does not support DRDT. 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.

  31. How do I report a bug or share my DRDT experience with others?
  32. The best resource for sharing your feedback with the DRDT engineers and users is by reading and posting to the Sun Studio Tools forum. You may find that your question has already been answered.

(Last updated June 19, 2006)