Incorrect POSIX_SPAWN_SETSIGDEF usage in wsrep_utils.cc

Bug #1399175 reported by Alexey Kopytov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Low
Alexey Kopytov
5.6
Fix Released
Low
Alexey Kopytov

Bug Description

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 signals as intended.

Related branches

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

This will be fixed in 5.6 with the patch for bug #1382797. As a side effect, because all code related to the posix_spawn*() family of functions will be replaced.

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

On a second thought, this bug will also be fixed in PXC 5.5.

description: updated
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1148

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.