Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Parasoft Jtest 2020.2

...

Failing to ensure the visibility of a shared primitive variable may result in a thread observing a stale value of the variable.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

VNA00-J

Medium

Probable

Medium

P8

L2

Automated Detection

Some static analysis tools are capable of detecting violations of this rule.

ToolVersionCheckerDescription
Eclipse4.2.0
 

Not Implemented
FindBugs2.0.1
 

Not Implemented
Parasoft Jtest
Include Page
java:
Parasoft_V
java:
Parasoft_V
TRS.LORD
,

TRS.MRAV
Implemented
Ensure that nested locks are ordered correctly
Access related Atomic variables in a synchronized block
PMD5.0.0
 

Not Implemented
Fortify
  


Not Implemented
Coverity7.5SERVLET_ATOMICITYImplemented
ThreadSafe
Include Page
ThreadSafe_V
ThreadSafe_V

CCE_SL_INCONSISTENT
CCE_CC_CALLBACK_ACCESS
CCE_SL_MIXED
CCE_SL_INCONSISTENT_COL
CCE_SL_MIXED_COL
CCE_CC_UNSAFE_CONTENT
CCE_FF_VOLATILE

Implemented

Related Guidelines

MITRE CWE

CWE-413, Improper Resource Locking
CWE-567, Unsynchronized Access to Shared Data in a Multithreaded Context
CWE-667, Improper Locking

Bibliography

[Bloch 2008]

Item 66, "Synchronize Access to Shared Mutable Data"

[Goetz 2006]

Section 3.4.2, "Example: Using Volatile to Publish Immutable Objects"

[JLS 2015]

Chapter 17, "Threads and Locks"
§17.4.3, "Programs and Program Order"
§17.4.5, "Happens-before Order"
§17.4.8, "Executions and Causality Requirements"

[JPL 2006]

Section 14.10.3, "The Happens-Before Relationship"

...


...