Return from computational exception signal handler
Undefined behavior when signal handler returns normally from program error
Description
This defect occurs
when a signal handler returns after catching a computational exception signal
SIGFPE, SIGILL, or SIGSEGV.
Risk
A signal handler that returns normally from a computational exception is undefined behavior. Even if the handler attempts to fix the error that triggered the signal, the program can behave unexpectedly.
Fix
Check the validity of the values of your variables before the computation to avoid using
a signal handler to catch exceptions. If you cannot avoid a handler to catch computation
exception signals, call abort(), quick_exit(), or
_Exit() in the handler to stop the program.
Examples
Result Information
| Group: Programming |
| Language: C | C++ |
| Default: On for handwritten code, off for generated code |
Command-Line Syntax:
SIG_HANDLER_COMP_EXCP_RETURN
|
| Impact: Low |
PQL Name:
std.defects.SIG_HANDLER_COMP_EXCP_RETURN
|
Version History
Introduced in R2017b
See Also
Function called from
signal handler not asynchronous-safe | Function called from
signal handler not asynchronous-safe (strict) | Signal call from within
signal handler | Find defects (-checkers)
Topics
- Interpret Polyspace Bug Finder Results in Polyspace Platform User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Polyspace Results Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)