Data Race Detector

by Devexperts

Child pages
  • Quick start guide
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Data Race Detector (DRD) is a tool for dynamic detection of data races in Java programs, implemented as a java agent. DRD works in same JVM with the target application and dynamically detects occuring and possible races. Results are logged to files, for each race additional information is printed: class+method+line number for both accesses, race type, at least one stacktrace.

How to use

  1. Download the last DRD version and unzip it to some folder (we'll further refer to it as DRD_HOME_DIR)
  2. Go to DRD_HOME_DIR/config directory. Rename two files in it: config-example.xml to config.xml and hb-config-example.xml to hb-config.xml
  3. Open config.xml. Find RaceDetection section and assure that rules inside it cover exactly your application and nothing more. Usually it's enough to have one rule based on unique prefix of your application packages. Also check that SyncInterception section is empty and defaultPolicy is "*"

    <SyncInterception defaultPolicy="include">
    <RaceDetection defaultPolicy="exclude">
        <Rule type="include" path="com/my/company/"/>
  4. Open Set "drd.config.dir" and "drd.log.dir" properties:

    drd.log.dir= #Absolute path to desired log dir. I.e. D:\Projects\DRD\log
    drd.config.dir= #Absolute path to DRD_HOME_DIR\config (if DRD_HOME_DIR=D:\Projects\DRD\ that it would be D:\Projects\DRD\config
  5. Locate exact place where java (javaw, ...) is actually executed to launch your application. Add DRD java agent and settings to launch parameters the following (note, prepend)
  • No labels