These checkers detect issues related to multitasking code such as data races where multiple tasks operate on an unprotected variable, or locking defects where critical sections are involved in a deadlock. Polyspace can detect thread and critical sections in your code, or you can manually define those in the Polyspace configuration.
|Calling thread might be cancelled in an unsafe state|
|Variable accessible between load and store operations|
|Variable can be modified between accesses|
|Variable is passed from one thread to another without ensuring that variable stays alive through duration of latter thread|
|Task performs lengthy operation while holding a lock|
|Multiple tasks perform unprotected nonatomic operations on shared variable|
|Multiple tasks perform unprotected operations on shared variable|
|Multiple threads perform unprotected operations on adjacent bit fields of a shared data structure|
|Multiple tasks make unprotected calls to thread-unsafe standard library function|
|Call sequence to lock functions cause two tasks to block each other|
|Task tries to destroy a mutex in the locked state|
|Lock function is called twice in a task without an intermediate call to unlock function|
|Unlock function is called twice in a task without an intermediate call to lock function|
|Loop checks failure condition after possible spurious failure|
|Loop checks wake-up condition after possible spurious wake-up|
|Thread that was previously joined or detached is joined or detached again|
|Unlock function without lock function|
|Duplicated initialization of thread attributes or noninitialized thread attribute used in functions that expect initialized attributes|
|Lock function without unlock function|
|Threads using different mutexes when concurrently waiting on the same condition variable is undefined behavior|
|Program with multiple threads uses |
|Dynamically allocated thread-specific memory not freed before end of thread|
|Uncaught signal kills entire process instead of specific thread|
|Thread ID from failed thread creation used in subsequent thread functions|
The Bug Finder defect checkers are classified into groups such as data flow, concurrency, numerical, and so on.
Detect data races or deadlocks with Bug Finder, or see a comprehensive analysis of shared variable usage with Code Prover.
Protect shared variables by using critical section, temporal exclusion, priorities, or interrupt disabling.