Comment 0 for bug 1399175

Revision history for this message
Alexey Kopytov (akopytov) wrote :

The code in the wsp::process class constructor uses posix_spawn() to create a child process. In particular, it sets the POSIX_SPAWN_SETSIGDEF flag via posix_spawnattr_setflags():

   err_ = posix_spawnattr_setflags (&attr, POSIX_SPAWN_SETSIGDEF |
                                           POSIX_SPAWN_USEVFORK);

The goal was apparently to reset the ignored (SIG_IGN) state set by the server for certain signals (e.g. SIGINT) back to their default handlers.

However, the POSIX_SPAWN_SETSIGDEF flag only makes sense when used together with a posix_spawnattr_setsigdefault() call, otherwise it has no effect because it will apply to an empty signal set. Quoting http://linux.die.net/man/3/posix_spawnattr_setsigdefault :

"
The spawn-sigdefault attribute represents the set of signals to be forced to default signal handling in the new process image (if POSIX_SPAWN_SETSIGDEF is set in the spawn-flags attribute) by a spawn operation. The default value of this attribute shall be an empty signal set.
"

As a result, the SST process spawn code does not reset any ignored signal as intended.