Reference

Configurations

Configurations are set in a configuration file named .coderrect.json. This configuration file should be placed in the directory where Coderrect is called.

Each configuration setting can only appear once in a configuration file, for example, you can NOT have multiple skipFunctions sections in a configuration file.

Command Line Options (by function groups)

Command line description
BASIC OPTIONS
-h, -help Print help information
-v, -version Print version information
-showconf Print configurations
PROCESS CONTROL
-bcPaths=/path/to/bcFileFolder1,/path/to/BCFilefolder2, -p paths Specify a list of paths separated by comma. These paths contain ./coderrect/build where BC files that aren't generated by the build process may reside
-cleanBuild, -c Remove all intermediate files generated by the last run of build.
Default:OFF.
-analyzeAllBinaries Analyze all qualified binaries generated by build.
Default: FALSE
-analyzeBinaries=[a],[b],... Only analyze a list of given binaries
-continueIfBuildErrorPresents Continue the analysis even though there are build errors.
Default: FALSE
-conf=path/to/custom_conf Specify a custom configuration file whose settings will be combined with settings in the default global coderrect.json, $HOME/.coderrect.json, and $projectDir/coderrect.json. The settings in this file override settings in other files.
DETECTION ALGORITHM
-mode=[normal][fast][exhaust] Set analyzing modes:
normal - this is the default mode. It trades off between the accuracy and speed.
fast: optimize for speed.
exhaust: optimize for accuracy and coverage.
Default Value: NORMAL
-enableOpenMP Enable OpenMP race detection
Default: True
-enableAtomicityViolation Enable atomicity violation detection
Default: True
-enableOrderViolation Enable order violation detection
Default: True
-enableMissingAPI Enable missing call pairs detection
Default: True
-enableFilter Enable filters to filter out potential false positives based on a set of heuristics
Default: True
-raceLimit=[value] Specify the up limit of how many races detected will be reported.
Default Value: 25
REPORT
-report.outputDir=/path/to/report, -o /path/to/report Specify where to generate the report
-report.enableTerminal, -t Generate the terminal-based report.
Default:FALSE.
LOGGER
-logger.level=[debug][info][warn][error][fatal] Set the minimum logging level. It supports five levels:
- debug
- info
- warn
- error
- fatal
Default Value: debug
-logger.logFolder=/../logFolder Specify the folder to store log files
-logger.maximumLogFileCount=[value] Specify maximum number of log files to keep
Default Value: 8
-logger.maximumLogFileSize=[value] Specify the maximum size (in MB) of a log file. When the size of a log file reaches this limit, logger will close this file and create a new file.
Default Value: 128
-logger.toStderr Specify if the logger prints logging messages to STDERR
Default: False
OPEN LIBRARY
-openlib.analyzeAPI Analyze a library and print out its published functions
Default: FALSE
-openlib.limit=[value] Specify the limit on the number of APIs to be analyzed
Default Value:999

Configurations to control the race detection algorithm

Skip Functions

Config Coderrect to skip specified functions during race analysis.

"skipFunctions":[
    "FunctionName*",
    "FunctionOther"
 ]

Check out a tutorial uses this configuration here


Indirect Functions

Config Coderrect to analyze all possible targets called in specified functions.

"indirectFunctions":[
    "FunctionName*",
    "FunctionOther"
 ]

Check out a tutorial uses this configuration here


Ignore Races in Functions

Config Coderrect to skip analysis specified functions.

"ignoreRacesInFunctions":[
    "std::*"
    "FunctionName*",
    "FunctionName2"
 ]

This configuration by default is set to skip all functions matching std::*.

Check out a tutorial uses this configuration here


Ignore Races at Locations

Config Coderrect to skip analysis on specified locations, i.e. filename and line numbers.

"ignoreRacesAtLocations": [
        "items.c:1277",
        "extstore.c:493"
],

Check out a tutorial uses this configuration here


Ignore Races by Variable Name

Config Coderrect to skip analysis on specified variables.

"ignoreRaceVariables":[
    "VariableName*",
    "VariableOtherName"
 ]

Check out a tutorial uses this configuration here


Set Low Priority Files

Races detected in specified files are set to a lower priority in the report, and shown lower in the report.

"lowPriorityFiles":[
    "FileName*",
    "FileNameOther"
 ]

Check out a tutorial uses this configuration here


Set High Priority Files

Races detected in specified files are set to a higher priority in the report, and shown lower in the report.

"highPriorityFiles":[
    "FileName*",
    "FunctionNameOther"
 ]

Check out a tutorial uses this configuration here


Set Low Priority Races

Races detected in specified variables are set to a lower priority in the report, and shown lower in the report.

"lowPriorityRaces":[
    "VariableName*",
    "VariableNameOther"
 ]

Check out a tutorial uses this configuration here


Set High Priority Races

Races detected in specified variables are set to a higher priority in the report, and shown lower in the report.

"highPriorityRaces":[
    "VariableName*",
    "VariableNameOther"
 ]

Check out a tutorial uses this configuration here


Mark Heap Allocation Functions

Specify functions to be treated as allocating memory.

"heapAllocFunctions":[
    "je_malloc",
    "je_calloc",
    "je_mallocx",
    "rm_malloc",
    "rm_calloc"
 ]

The setting show in the above example is the default setting.


Set Entry Points to Analyze Libraries

Specify entry points for libraries without a main function.

"openlib": {
  "entryPoints":[
    "FunctionName*",
    "FunctionNameOther"
   ]
}

Check out a tutorial uses this configuration here


Specify Custom Lock/Unlock APIs

Specify a list of custom lock/unlock APIs so that Coderrect can make corrrect reasoning.

"lockUnlockFunctions": {
  "MySpinLock": "MySpinUnlock",
  "MyMutexLock": "MyMutexUnlock"
}

Check out a tutorial uses this configuration here


The default global configuration file

You can find the default global configuration file “coderrect.json” under $installDir/conf.

{
  "logger": {
    "level": "debug",
    "logFolder": "logs",
    "maximumLogFileCount": 8,
    "maximumLogFileSize": 128,
    "toStderr": false
  },

  "report": {
    "enableTerminal": false,
    "//ouputDir": "please remove // and set the right path here"
  },

  "cleanBuild":                   false,
  "analyzeAllBinaries":           false,
  "continueIfBuildErrorPresents": false,
  "//bcPaths":                    "Remove // and specify a list of comma-separated paths",
  "//analyzeBinaries":            "Remove // and specify a list of comma-separated binary names",

  "publishResults":               false,

  "mode":                         "normal",
  "enableOpenMP":                 true,
  "enableOrderViolation":         true,
  "enableAtomicityViolation":     true,
  "enableMissingAPI":             true,
  "enableFilter":                 true,
  "enableLockSet":                true,
  "enableLoopUnroll":             true,

  "raceLimit":                    25,

  "skipFunctions":                [],
  "indirectFunctions":            [],
  "ignoreRacesInFunctions":       [
        "std::*"
  ],
  "ignoreRacesAtLocations":       [],
  "ignoreRaceVariables":          [],
  "lowPriorityFiles":             [],
  "lowPriorityRaces":             [],
  "highPriorityRaces":            [],
  "heapAllocFunctions":           [
     "je_malloc",
     "je_calloc",
     "je_mallocx",
     "rm_malloc",
     "rm_calloc"
  ],
  "lockUnlockFunctions":          {},
  "notParallelFunctionPairs":     {}

  "highPriorityFiles":            [],
  "lowPriorityFiles":             [],
  "highPriorityRaces":            [],
  "lowPriorityRaces":             [],

  "openlib": {
    "entryPoints":                [],
    "limit":                      999,
  }
}