...
When operations on shared variables are not atomic, unexpected results can be produced. For example, information can be disclosed inadvertently because one user can receive information about other users.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
|---|---|---|---|---|---|---|
VNA02-J | Medium | Probable | Yes | MediumNo | P8 | L2 |
Automated Detection
Some available static analysis tools can detect the instances of non-atomic update of a concurrently shared value. The result of the update is determined by the interleaving of thread execution. These tools can detect the instances where thread-shared data is accessed without holding an appropriate lock, possibly causing a race condition.
| Tool | Version | Checker | Description | CodeSonar | 4.2 | FB.MT_CORRECTNESS.IS2_INCONSISTENT_SYNC FB.MT_CORRECTNESS.IS_FIELD_NOT_GUARDED FB.MT_CORRECTNESS.STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE FB.MT_CORRECTNESS.STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE FB.MT_CORRECTNESS.STCAL_STATIC_CALENDAR_INSTANCE FB.MT_CORRECTNESS.STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE | Version | Checker | Description | Inconsistent synchronization||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Coverity | 7.5 | GUARDED_BY_VIOLATION | Implemented | ||||||||
| Klocwork |
| SV.SHARED.VAR | |||||||||
| Parasoft Jtest |
| TRSCERT.VNA02.SSUG | TRSCERT.VNA02.MRAV | Make the get method for a field synchronized if the set method is synchronized Access related Atomic variables in a synchronized block | |||||||
| PVS-Studio |
| V6074 | |||||||||
| ThreadSafe |
| CCE_SL_INCONSISTENT | Implemented |
Related Guidelines
...