{"id":4274,"date":"2020-12-12T11:06:10","date_gmt":"2020-12-12T17:06:10","guid":{"rendered":"https:\/\/coderrect.com\/?post_type=docs&p=4274"},"modified":"2021-01-06T15:23:37","modified_gmt":"2021-01-06T21:23:37","slug":"reference","status":"publish","type":"docs","link":"https:\/\/coderrect.com\/docs\/reference\/","title":{"rendered":"Reference"},"content":{"rendered":"\n

Reference<\/h1>\n\n\n\n

Configurations<\/h2>\n\n\n\n

Configurations are set in a configuration file named .coderrect.json.<\/em> This configuration file should be placed in the directory where Coderrect is called.<\/p>\n\n\n\n

Each configuration setting can only appear once in a configuration file, for example, you can NOT have multiple skipFunctions sections in a configuration file. <\/p>\n\n\n\n

Command Line Options (by function groups)<\/h2>\n\n\n\n
COMMAND LINE<\/th>DESCRIPTION<\/th><\/tr><\/thead>
BASIC OPTIONS<\/strong><\/td><\/td><\/tr>
-h, -help<\/td>Print help information<\/td><\/tr>
-v, -version<\/td>Print version information<\/td><\/tr>
-showconf<\/td>Print configurations<\/td><\/tr>
<\/td><\/td><\/tr>
PROCESS CONTROL<\/strong><\/td><\/td><\/tr>
-bcPaths=\/path\/to\/bcFileFolder1,\/path\/to\/BCFilefolder2, -p paths<\/td>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<\/td><\/tr>
-cleanBuild, -c<\/td>Remove all intermediate files generated by the last run of build.
Default:OFF<\/strong>.<\/em><\/td><\/tr>
-analyzeAllBinaries<\/td>Analyze all qualified binaries generated by build.
Default: <\/strong>FALSE<\/em><\/td><\/tr>
-analyzeBinaries=[a],[b],…<\/td>Only analyze a list of given binaries<\/td><\/tr>
-continueIfBuildErrorPresents<\/td>Continue the analysis even though there are build errors.
Default: FALSE<\/strong><\/em><\/td><\/tr>
-conf=path\/to\/custom_conf<\/td>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.<\/td><\/tr>
<\/td><\/td><\/tr>
DETECTION ALGORITHM<\/strong><\/td><\/td><\/tr>
-mode=[normal][fast][exhaust]<\/td>Set analyzing modes:
normal<\/strong> – this is the default mode. It trades off between the accuracy and speed.
fast<\/strong>: optimize for speed.
exhaust<\/strong>: optimize for accuracy and coverage.
Default Value: NORMAL<\/strong><\/em><\/td><\/tr>
-enableOpenMP<\/td>Enable OpenMP race detection
Default: True<\/em><\/strong><\/td><\/tr>
-enableAtomicityViolation<\/td>Enable atomicity violation detection
Default: True<\/em><\/strong><\/td><\/tr>
-enableOrderViolation<\/td>Enable order violation detection
Default: True<\/em><\/strong><\/td><\/tr>
-enableMissingAPI<\/td>Enable missing call pairs detection
Default: True<\/em><\/strong><\/td><\/tr>
-enableFilter<\/td>Enable filters to filter out potential false positives based on a set of heuristics
Default: True<\/em><\/strong><\/td><\/tr>
-raceLimit=[value]<\/td>Specify the up limit of how many races detected will be reported.
Default Value: 25<\/strong><\/em><\/td><\/tr>
<\/td><\/td><\/tr>
REPORT<\/strong><\/td><\/td><\/tr>
-report.outputDir=\/path\/to\/report, -o \/path\/to\/report<\/td>Specify where to generate the report<\/td><\/tr>
-report.enableTerminal, -t<\/td>Generate the terminal-based report.
Default:FALSE.<\/em><\/strong><\/td><\/tr>
<\/td><\/td><\/tr>
LOGGER<\/strong><\/td><\/td><\/tr>
-logger.level=[debug][info][warn][error][fatal]<\/td>Set the minimum logging level. It supports five levels:
– debug
– info
– warn
– error
– fatal
Default Value: debug<\/em><\/strong><\/td><\/tr>
-logger.logFolder=\/..\/logFolder<\/td>Specify the folder to store log files<\/td><\/tr>
-logger.maximumLogFileCount=[value]<\/td>Specify maximum number of log files to keep
Default Value: 8<\/em><\/strong><\/td><\/tr>
-logger.maximumLogFileSize=[value]<\/td>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<\/em><\/strong><\/td><\/tr>
-logger.toStderr<\/td>Specify if the logger prints logging messages to STDERR
Default: False<\/em><\/strong><\/td><\/tr>
<\/td><\/td><\/tr>
OPEN LIBRARY<\/strong><\/td><\/td><\/tr>
-openlib.analyzeAPI<\/td>Analyze a library and print out its published functions
Default: FALSE<\/em><\/strong><\/td><\/tr>
-openlib.limit=[value]<\/td>Specify the limit on the number of APIs to be analyzed
Default Value:999<\/em><\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n
\n\n\n\n

Configurations to control the race detection algorithm<\/h2>\n\n\n\n

Skip Functions<\/strong><\/h4>\n\n\n\n

Config Coderrect to skip specified functions during race analysis.<\/p>\n\n\n\n

\"skipFunctions\":[\n    \"FunctionName*\",\n    \"FunctionOther\"\n] <\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Indirect Functions<\/strong><\/h4>\n\n\n\n

Config Coderrect to analyze all possible targets called in specified functions.<\/p>\n\n\n\n

\"indirectFunctions\":[\n    \"FunctionName*\",\n    \"FunctionOther\"\n]<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Ignore Races in Functions<\/strong><\/h4>\n\n\n\n

Config Coderrect to skip analysis specified functions.<\/p>\n\n\n\n

\"ignoreRacesInFunctions\":[\n    \"std::*\"\n    \"FunctionName*\",\n    \"FunctionName2\"\n]<\/pre>\n\n\n\n

This configuration by default is set to skip all functions matching std::*<\/strong>.<\/p>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Ignore Races at Locations<\/strong><\/h4>\n\n\n\n

Config Coderrect to skip analysis on specified locations, i.e. filename and line numbers.<\/p>\n\n\n\n

\"ignoreRacesAtLocations\": [\n    \"items.c:1277\",\n    \"extstore.c:493\"\n],<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Ignore Races by Variable<\/strong> Name<\/strong><\/h4>\n\n\n\n

Config Coderrect to skip analysis on specified variables.<\/p>\n\n\n\n

\"ignoreRaceVariables\":[\n    \"VariableName*\",\n    \"VariableOtherName\"\n]<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Set Low Priority Files<\/strong><\/h4>\n\n\n\n

Races detected in specified files are set to a lower priority in the report, and shown lower in the report.<\/p>\n\n\n\n

\"lowPriorityFiles\":[\n    \"FileName*\",\n    \"FileNameOther\"\n]<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Set High Priority Files<\/strong><\/h4>\n\n\n\n

Races detected in specified files are set to a higher priority in the report, and shown lower in the report.<\/p>\n\n\n\n

\"highPriorityFiles\":[\n    \"FileName*\",\n    \"FunctionNameOther\"\n]<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Set Low Priority Races<\/strong><\/h4>\n\n\n\n

Races detected in specified variables are set to a lower priority in the report, and shown lower in the report.<\/p>\n\n\n\n

\"lowPriorityRaces\":[\n    \"VariableName*\",\n    \"VariableNameOther\"\n]<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Set High Priority Races<\/strong><\/h4>\n\n\n\n

Races detected in specified variables are set to a higher priority in the report, and shown lower in the report.<\/p>\n\n\n\n

\"highPriorityRaces\":[\n    \"VariableName*\",\n    \"VariableNameOther\"\n]<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Mark Heap Allocation Functions<\/strong><\/h4>\n\n\n\n

Specify functions to be treated as allocating memory.<\/p>\n\n\n\n

\"heapAllocFunctions\":[\n    \"je_malloc\",\n    \"je_calloc\",\n    \"je_mallocx\",\n    \"rm_malloc\",\n    \"rm_calloc\"\n]<\/pre>\n\n\n\n

 <\/p>\n\n\n\n

The setting show in the above example is the default setting.<\/p>\n\n\n\n


\n\n\n\n

Set Entry Points<\/strong> to Analyze Libraries<\/h4>\n\n\n\n

Specify entry points for libraries without a main function.<\/p>\n\n\n\n

\"openlib\": {\n    \"entryPoints\":[\n        \"FunctionName*\",\n        \"FunctionNameOther\"\n    ]\n}<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/strong><\/p>\n\n\n\n


\n\n\n\n

Specify Custom Lock\/Unlock APIs<\/h4>\n\n\n\n

Specify a list of custom lock\/unlock APIs so that Coderrect can make corrrect reasoning.\u00a0<\/p>\n\n\n\n

\"lockUnlockFunctions\": {\n    \"MySpinLock\": \"MySpinUnlock\",\n    \"MyMutexLock\": \"MyMutexUnlock\"\n}<\/pre>\n\n\n\n

Check out a tutorial uses this configuration here<\/a><\/p>\n\n\n\n


\n\n\n\n

The default global configuration file<\/h2>\n\n\n\n

You can find the default global configuration file \u201ccoderrect.json\u201d under $installDir\/conf.<\/p>\n\n\n\n

{\n  \"logger\": {\n    \"level\": \"debug\",\n    \"logFolder\": \"logs\",\n    \"maximumLogFileCount\": 8,\n    \"maximumLogFileSize\": 128,\n    \"toStderr\": false\n  },\n\n  \"report\": {\n    \"enableTerminal\": false,\n    \"\/\/ouputDir\": \"please remove \/\/ and set the right path here\"\n  },\n\n  \"cleanBuild\":                   false,\n  \"analyzeAllBinaries\":           false,\n  \"continueIfBuildErrorPresents\": false,\n  \"\/\/bcPaths\":                    \"Remove \/\/ and specify a list of comma-separated paths\",\n  \"\/\/analyzeBinaries\":            \"Remove \/\/ and specify a list of comma-separated binary names\",\n\n  \"publishResults\":               false,\n\n  \"mode\":                         \"normal\",\n  \"enableOpenMP\":                 true,\n  \"enableOrderViolation\":         true,\n  \"enableAtomicityViolation\":     true,\n  \"enableMissingAPI\":             true,\n  \"enableFilter\":                 true,\n  \"enableLockSet\":                true,\n  \"enableLoopUnroll\":             true,\n\n  \"raceLimit\":                    25,\n\n  \"skipFunctions\":                [],\n  \"indirectFunctions\":            [],\n  \"ignoreRacesInFunctions\":       [\n        \"std::*\"\n  ],\n  \"ignoreRacesAtLocations\":       [],\n  \"ignoreRaceVariables\":          [],\n  \"lowPriorityFiles\":             [],\n  \"lowPriorityRaces\":             [],\n  \"highPriorityRaces\":            [],\n  \"heapAllocFunctions\":           [\n     \"je_malloc\",\n     \"je_calloc\",\n     \"je_mallocx\",\n     \"rm_malloc\",\n     \"rm_calloc\"\n  ],\n  \"lockUnlockFunctions\":          {},\n  \"notParallelFunctionPairs\":     {}\n\n  \"highPriorityFiles\":            [],\n  \"lowPriorityFiles\":             [],\n  \"highPriorityRaces\":            [],\n  \"lowPriorityRaces\":             [],\n\n  \"openlib\": {\n    \"entryPoints\":                [],\n    \"limit\":                      999,\n  }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"

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,<\/p>\n","protected":false},"author":182999572,"featured_media":0,"parent":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false},"doc_category":[1415],"doc_tag":[],"jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/docs\/4274"}],"collection":[{"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/users\/182999572"}],"replies":[{"embeddable":true,"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/comments?post=4274"}],"version-history":[{"count":14,"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/docs\/4274\/revisions"}],"predecessor-version":[{"id":4524,"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/docs\/4274\/revisions\/4524"}],"wp:attachment":[{"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/media?parent=4274"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/doc_category?post=4274"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/coderrect.com\/wp-json\/wp\/v2\/doc_tag?post=4274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}