Skip to content

Commit 4c00e2c

Browse files
author
Ralph Castain
authored
Merge pull request #3620 from rhc54/topic/grr
Fix uninitialized variable. Set exit codes for failed launch so we get pretty error messages
2 parents e1a997c + 9d6b929 commit 4c00e2c

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

opal/mca/pmix/base/pmix_base_fns.c

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ static void lookup_cbfunc(int status, opal_list_t *data, void *cbdata)
121121
static void opcbfunc(int status, void *cbdata)
122122
{
123123
struct lookup_caddy_t *cd = (struct lookup_caddy_t*)cbdata;
124+
cd->status = status;
124125
cd->active = false;
125126
}
126127

@@ -155,27 +156,29 @@ int opal_pmix_base_exchange(opal_value_t *indat,
155156
return rc;
156157
}
157158
} else {
158-
caddy.active = true;
159-
rc = opal_pmix.publish_nb(&ilist, opcbfunc, &caddy);
160-
if (OPAL_SUCCESS != rc) {
161-
OPAL_ERROR_LOG(rc);
162-
OPAL_LIST_DESTRUCT(&ilist);
163-
return rc;
164-
}
165-
while (caddy.active) {
166-
usleep(10);
167-
}
168-
OPAL_LIST_DESTRUCT(&ilist);
169-
if (OPAL_SUCCESS != caddy.status) {
170-
OPAL_ERROR_LOG(caddy.status);
171-
return caddy.status;
172-
}
173-
}
174-
175-
/* lookup the other side's info - if a non-blocking form
176-
* of lookup isn't available, then we use the blocking
177-
* form and trust that the underlying system will WAIT
178-
* until the other side publishes its data */
159+
caddy.status = -1;
160+
caddy.active = true;
161+
caddy.pdat = NULL;
162+
rc = opal_pmix.publish_nb(&ilist, opcbfunc, &caddy);
163+
if (OPAL_SUCCESS != rc) {
164+
OPAL_ERROR_LOG(rc);
165+
OPAL_LIST_DESTRUCT(&ilist);
166+
return rc;
167+
}
168+
while (caddy.active) {
169+
usleep(10);
170+
}
171+
OPAL_LIST_DESTRUCT(&ilist);
172+
if (OPAL_SUCCESS != caddy.status) {
173+
OPAL_ERROR_LOG(caddy.status);
174+
return caddy.status;
175+
}
176+
}
177+
178+
/* lookup the other side's info - if a non-blocking form
179+
* of lookup isn't available, then we use the blocking
180+
* form and trust that the underlying system will WAIT
181+
* until the other side publishes its data */
179182
pdat = OBJ_NEW(opal_pmix_pdata_t);
180183
pdat->value.key = strdup(outdat->value.key);
181184
pdat->value.type = outdat->value.type;
@@ -214,6 +217,7 @@ int opal_pmix_base_exchange(opal_value_t *indat,
214217
return rc;
215218
}
216219
} else {
220+
caddy.status = -1;
217221
caddy.active = true;
218222
caddy.pdat = pdat;
219223
keys = NULL;

orte/mca/odls/base/odls_base_default_fns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,6 @@ void orte_odls_base_spawn_proc(int fd, short sd, void *cbdata)
702702
opal_argv_free(argvptr);
703703
}
704704
if (ORTE_SUCCESS != rc) {
705-
opal_output(0, "%s:%d", __FILE__, __LINE__);
706705
state = ORTE_PROC_STATE_FAILED_TO_LAUNCH;
707706
goto errorout;
708707
}
@@ -798,6 +797,7 @@ void orte_odls_base_spawn_proc(int fd, short sd, void *cbdata)
798797

799798
errorout:
800799
ORTE_FLAG_UNSET(child, ORTE_PROC_FLAG_ALIVE);
800+
child->exit_code = rc;
801801
ORTE_ACTIVATE_PROC_STATE(&child->name, state);
802802
OBJ_RELEASE(cd);
803803
}

0 commit comments

Comments
 (0)