From 63ea04035552634532542e59795ca5e902e61171 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Mon, 26 Apr 2021 13:41:16 -0700 Subject: [PATCH] [racerd] clarify C++/ObjC behaviour Reviewed By: jvillard Differential Revision: D27996744 fbshipit-source-id: dfcf1dbeb --- infer/documentation/checkers/RacerD.md | 4 +++- infer/documentation/issues/LOCK_CONSISTENCY_VIOLATION.md | 9 ++++----- infer/src/base/IssueType.ml | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/infer/documentation/checkers/RacerD.md b/infer/documentation/checkers/RacerD.md index 4f8e118c9..934245a64 100644 --- a/infer/documentation/checkers/RacerD.md +++ b/infer/documentation/checkers/RacerD.md @@ -1,6 +1,8 @@ -RacerD finds data races in your C++ and Java code. This page gives a more in-depth +RacerD finds data races in your C++/Objective C and Java code. This page gives a more in-depth explanation of how the analysis works *for Java code*, but may be less complete than the [Thread Safety Violation bug description page](/docs/next/all-issue-types#thread_safety_violation). +For information on C++ and Objective C, see the +[Lock Consistency violation page](/docs/next/all-issue-types#lock_consistency_violation). To run the analysis, you can use plain `infer` (to run RacerD along with other analyses that are run by default) or `infer --racerd-only` (to run only RacerD). diff --git a/infer/documentation/issues/LOCK_CONSISTENCY_VIOLATION.md b/infer/documentation/issues/LOCK_CONSISTENCY_VIOLATION.md index ab32d00af..04ab53fda 100644 --- a/infer/documentation/issues/LOCK_CONSISTENCY_VIOLATION.md +++ b/infer/documentation/issues/LOCK_CONSISTENCY_VIOLATION.md @@ -1,9 +1,8 @@ -This is a C++ and Objective C error reported whenever: +This is an error reported on C++ and Objective C classes whenever: -- A class contains a member `lock` used for synchronization (most often a - `std::mutex`). -- It has a public method which writes to some member `x` while holding `lock`. -- It has a public method which reads `x` without holding `lock`. +- Some class method directly uses locking primitives (not transitively). +- It has a public method which writes to some member `x` while holding a lock. +- It has a public method which reads `x` without holding a lock. The above may happen through a chain of calls. Above, `x` may also be a container (an array, a vector, etc). diff --git a/infer/src/base/IssueType.ml b/infer/src/base/IssueType.ml index 2c924f8de..f67b92345 100644 --- a/infer/src/base/IssueType.ml +++ b/infer/src/base/IssueType.ml @@ -918,7 +918,8 @@ let thread_safety_violation = let thread_safety_violation_nullsafe = register Warning ~id:"THREAD_SAFETY_VIOLATION_NULLSAFE" RacerD ~hum:"Thread Safety Violation in `@Nullsafe` Class" - ~user_documentation:[%blob "../../documentation/issues/THREAD_SAFETY_VIOLATION.md"] + ~user_documentation: + "A [Thread Safety Violation](#thread_safety_violation) in a `@Nullsafe` class." let complexity_increase ~kind ~is_on_ui_thread =