Signals and Situations
Signals and Situations
Copyright(c) Management Analytics, 1995 - All Rights Reserved
Copyright(c), 1990, 1995 Dr. Frederick B. Cohen - All Rights Reserved
Problem:
The signalling system under UNIX is essentially a model of a
priority interrupt handling system. Since this is an asynchronous
operation that is not controllable by the program, the number of
different machine states that could apply when the signal is handled is
enormous. As a result, it is impossible to fully test interrupt handling,
and without great care in design, it may be impossible to get it right.
A simple interrupt handler might store the registers on the stack,
and call a handler routine. Upon return, the handler restores the registers
from the stack, and proceeds to do whatever it was doing before. This works
well, as long as the stack is not nearly full when the interrupt takes place.
If there is a stack overrun, it causes another interrupt, which in turn
tries to push onto the stack, and off we go into an infinite recursion.
Prevention:
A theoretically sound interrupt handling system would solve the
problem, but there is no practical way for a systems administrator to
eliminate this problem. System designers often provide less than the
worst case resource requirements because it is too expensive to cover
relatively unlikely circumstances.
Detection:
There is no simple way to detect this particular problem in
an operating system.
Cure:
The system is normally rebooted after this sort of problem because
normal operation deteriorates rapidly and a system crash is often
inevitable.