Incorrect POSIX_SPAWN_SETSIGDEF usage in

Bug #1399175 reported by Alexey Kopytov on 2014-12-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to
Status tracked in 5.6
Fix Released
Alexey Kopytov
Fix Released
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 |

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 :

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

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.

Alexey Kopytov (akopytov) wrote :

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

description: updated

Percona now uses JIRA for bug reports so this bug report is migrated to:

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

Other bug subscribers