Hauptinhalt

Die Übersetzung dieser Seite ist veraltet. Klicken Sie hier, um die neueste Version auf Englisch zu sehen.

Nebenläufigkeitsdefekte

Defekte in Zusammenhang mit Multitasking-Code

Diese Code-Checker erkennen Probleme im Zusammenhang mit Multitasking-Code, wie z. B. Wettlaufsituationen, bei denen mehrere Tasks auf eine ungeschützte Variable zugreifen, oder Verklemmungs-Defekte, bei denen kritische Abschnitte in einen Deadlock verwickelt sind. Polyspace kann Threads und kritische Abschnitte in Ihrem Code erkennen, oder Sie können diese manuell in der Polyspace-Konfiguration definieren.

Polyspace-Ergebnisse

alle erweitern

Data raceMultiple tasks perform unprotected nonatomic operations on shared variable
Data race onadjacent bit fieldsMultiple threads perform unprotected operations on adjacent bit fields of a shared data structure
Data race through standard library functioncallMultiple tasks make unprotected calls to thread-unsafe standard library function
Blockingoperation while holding lockTask performs lengthy operation while holding a lock
DeadlockCall sequence to lock functions cause two tasks to block each other
Destruction of locked mutexTask tries to destroy a mutex in the locked state
Double lockLock function is called twice in a task without an intermediate call to unlock function
Double unlockUnlock function is called twice in a task without an intermediate call to lock function
Missing lockUnlock function without lock function
Missing unlockLock function without unlock function
Multiple mutexesused with same condition variableThreads using different mutexes when concurrently waiting on the same condition variable is undefined behavior
Asynchronouslycancellable threadCalling thread might be canceled in an unsafe state
Join or detach ofa joined or detached threadThread that was previously joined or detached is joined or detached again
Missing or doubleinitialization of thread attributeDuplicated initialization of thread attributes or noninitialized thread attribute used in functions that expect initialized attributes
Multiple threadswaiting on same condition variableUsing cnd_signal or std::condition_variable::notify_one() to notify one of the threads waiting for the same condition variable might result in indefinite blocking
Signal call inmultithreaded programProgram with multiple threads uses signal function
Use of signalkilling threadUncaught signal kills entire process instead of specific thread
Use of undefinedthread IDThread ID from failed thread creation used in subsequent thread functions
Automatic orthread local variable escaping from a threadVariable is passed from one thread to another without ensuring that variable stays alive through duration of latter thread
Thread-specificmemory leakDynamically allocated thread-specific memory not freed before end of thread
Atomic load and store sequence notatomicVariable accessible between load and store operations
Atomic variable accessed twice inan expressionVariable can be modified between accesses
Function that can spuriously failnot wrapped in loopLoop checks failure condition after possible spurious failure
Function that can spuriously wakeup not wrapped in loopLoop checks wake-up condition after possible spurious wake-up

Themen