...
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 | NoMedium | 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 | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Coverity | 7.5 | GUARDED_BY_VIOLATION | Implemented | ||||||
| Klocwork |
| SV.SHARED.VAR | |||||||
| Parasoft Jtest |
| CERT.VNA02.SSUG CERT.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
...