blockUserSignal() should use SIG_BLOCK instead of SIG_SETMASK, otherwise it would also sometimes unblock signals that should be blocked. MERGE TO STABLE