Skip to content

Commit 647a760

Browse files
author
Ralph Castain
committed
Ensure SIGCHLD is unblocked
Thanks to @hjelmn for debugging it and providing the patch Signed-off-by: Ralph Castain <rhc@open-mpi.org> (cherry picked from commit efa8bcc)
1 parent 9ea5dfa commit 647a760

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

orte/mca/odls/base/odls_base_frame.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "orte/constants.h"
2929

3030
#include <string.h>
31+
#include <signal.h>
3132

3233
#include "opal/class/opal_ring_buffer.h"
3334
#include "orte/mca/mca.h"
@@ -226,6 +227,7 @@ static int orte_odls_base_open(mca_base_open_flag_t flags)
226227
int rc, i, rank;
227228
orte_namelist_t *nm;
228229
bool xterm_hold;
230+
sigset_t unblock;
229231

230232
ORTE_CONSTRUCT_LOCK(&orte_odls_globals.lock);
231233
orte_odls_globals.lock.active = false; // start with nobody having the thread
@@ -244,6 +246,17 @@ static int orte_odls_base_open(mca_base_open_flag_t flags)
244246
OBJ_CONSTRUCT(&orte_odls_globals.xterm_ranks, opal_list_t);
245247
orte_odls_globals.xtermcmd = NULL;
246248

249+
/* ensure that SIGCHLD is unblocked as we need to capture it */
250+
if (0 != sigemptyset(&unblock)) {
251+
return ORTE_ERROR;
252+
}
253+
if (0 != sigaddset(&unblock, SIGCHLD)) {
254+
return ORTE_ERROR;
255+
}
256+
if (0 != sigprocmask(SIG_UNBLOCK, &unblock, NULL)) {
257+
return ORTE_ERR_NOT_SUPPORTED;
258+
}
259+
247260
/* check if the user requested that we display output in xterms */
248261
if (NULL != orte_xterm) {
249262
/* construct a list of ranks to be displayed */

0 commit comments

Comments
 (0)