Skip to content

Commit

Permalink
a fix a bug introduced by PR 11854
Browse files Browse the repository at this point in the history
PR #11854 introduced a big that causes singleton runs to
segfault at startup in some cases

this bug was rooted out by the github action in
PR #12217

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit 86a05c1)
  • Loading branch information
hppritcha committed Jan 19, 2024
1 parent a2dee36 commit 187ae25
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions opal/mca/pmix/base/pmix_base_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static bool check_pmix_overlap(char *var, char *value)
// changes here, there are likely to be changes there.
static void translate_params(void)
{
char *evar, *tmp, *e2;
char *evar = NULL, *tmp, *e2 = NULL;
char *file;
const char *home;
opal_list_t params;
Expand Down Expand Up @@ -193,20 +193,22 @@ static void translate_params(void)
home = opal_home_directory();
if (NULL != home) {
file = opal_os_path(false, home, ".openmpi", "mca-params.conf", NULL);
OBJ_CONSTRUCT(&params, opal_list_t);
mca_base_parse_paramfile(file, &params);
free(file);
OPAL_LIST_FOREACH (fv, &params, mca_base_var_file_value_t) {
pmix_overlap = check_pmix_overlap(&e2[len], evar);
if (!pmix_overlap && check_pmix_param(fv->mbvfv_var)) {
opal_asprintf(&tmp, "PMIX_MCA_%s", fv->mbvfv_var);
// set it, but don't overwrite if they already
// have a value in our environment
setenv(tmp, fv->mbvfv_value, false);
free(tmp);
if (NULL != file) {
OBJ_CONSTRUCT(&params, opal_list_t);
mca_base_parse_paramfile(file, &params);
free(file);
OPAL_LIST_FOREACH (fv, &params, mca_base_var_file_value_t) {
pmix_overlap = check_pmix_overlap(fv->mbvfv_var, fv->mbvfv_value);
if (!pmix_overlap && check_pmix_param(fv->mbvfv_var)) {
opal_asprintf(&tmp, "PMIX_MCA_%s", fv->mbvfv_var);
// set it, but don't overwrite if they already
// have a value in our environment
setenv(tmp, fv->mbvfv_value, false);
free(tmp);
}
}
OPAL_LIST_DESTRUCT(&params);
}
OPAL_LIST_DESTRUCT(&params);
}

/* check if the user has set OMPIHOME in their environment */
Expand Down

0 comments on commit 187ae25

Please sign in to comment.