Use of signal to kill thread
Uncaught signal kills entire process instead of specific thread
Description
This defect occurs when you use an
uncaught signal to kill a thread. For instance, you use the POSIX® function pthread_kill
and send the signal
SIGTERM
to kill a thread.
Risk
Sending a signal kills the entire process instead of just the thread that you intend to kill.
For instance, the pthread_kill
specifications state that if the disposition of
a signal is to terminate, this action affects the entire process.
Fix
Use other mechanisms that are intended to kill specific threads.
For instance, use the POSIX function pthread_cancel
to terminate a specific
thread.
Examples
Result Information
Group: Concurrency |
Language: C | C++ |
Default: Off |
Command-Line Syntax:
THREAD_KILLED_WITH_SIGNAL |
Impact: Low |
Version History
Introduced in R2018b
See Also
Signal call in
multithreaded program
| Find defects (-checkers)
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)