
...
However, the C Standard, 6.2.4 paragraphs 4 and 5 5 [ISO/IEC 9899:20112024], states:
The result of attempting to indirectly access an object with thread storage duration from a thread other than the one with which the object is associated is implementation-defined. . . .
The result of attempting to indirectly access an object with automatic storage duration from a thread other than the one with which the object is associated is implementation-defined.
...
Recommendation | Severity | Likelihood | Detectable | Remediation CostRepairable | Priority | Level |
---|---|---|---|---|---|---|
CON34-C | Medium | Probable | No | HighNo | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Astrée |
| Supported, resulting undefined behavior is reported by the runtime error analysis | |||||||
CodeSonar |
| CONCURRENCY.LOCALARG | Local Variable Passed to Thread Inappropriate Storage Duration | ||||||
Cppcheck Premium |
| premium-cert-con34-c | |||||||
Helix QAC |
| DF4926, DF4927, DF4928 | |||||||
Parasoft C/C++test |
| CERT_C-CON34-a | Declare objects shared between POSIX threads with appropriate storage durations | ||||||
Polyspace Bug Finder |
| CERT C: Rule CON34-C | Checks for automatic or thread local variable escaping from a C11 thread (rule fully covered) |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...
Bibliography
[ISO/IEC 9899:20112024] | 6.2.4, "Storage Durations of Objects" |
[OpenMP] | The OpenMP® API Specification for Parallel Programming |
...