fffffffe3bfbea27 is 1111111111111111111111111111111000111011111110111110101000100111 which means that all but 12 signals are actually blocked! Only 4: SIGILL, 5: SIGTRAP, 7: SIGBUS, 8: SIGFPE, 9: SIGKILL, 11: SIGSEGV, 13: SIGPIPE, 19: SIGSTOP, 27: SIGPROF and 31: SIGSYS seem not blocked.
I spawned two processes
/bin/cat -nu
one fromFoundation.Process
(pid 15477) and one from my shell (pid 15480)and the one from
Foundation.Process
is unkillable with SIGTERM:where as the other one will die immediately on SIGTERM. Why is that?
15477 (the one from Foundation.Process) has a lot of signals blocked (see
SigBlk
)fffffffe3bfbea27
is1111111111111111111111111111111000111011111110111110101000100111
which means that all but 12 signals are actually blocked! Only 4: SIGILL, 5: SIGTRAP, 7: SIGBUS, 8: SIGFPE, 9: SIGKILL, 11: SIGSEGV, 13: SIGPIPE, 19: SIGSTOP, 27: SIGPROF and 31: SIGSYS seem not blocked.That looks very curiously exactly like Dispatch's sigmask for its worker threads: https://github.com/apple/swift-corelibs-libdispatch/blob/9566a131de09a472790f7b69ae661326cdedf306/src/init.c#L91-L110 .
The normal
/bin/cat -nu
spawned from my shell has (as expected) a wholly 0 SigBlk mask (which means all signals are coming through).