This is the expected behavior. Quoting from the unix man page:
SIGKILL and SIGSTOP signals cannot be caught, blocked, or ignored.
And the BSD man page indicates that:
The signal () function will not be executed, and no action will be taken if one of the following events occurs:
[EINVAL] The sig argument is not a valid signal number. [EINVAL] An attempt is made to ignore or supply a handler for SIGKILL or SIGSTOP.
In conclusion, you cannot install a handler for SIGSTOP. And the process will remain paused until it receives SIGCONT .
source share