diff --git a/config/opal_check_pmi.m4 b/config/opal_check_pmi.m4 index 8877d672f53..956a17591de 100644 --- a/config/opal_check_pmi.m4 +++ b/config/opal_check_pmi.m4 @@ -13,7 +13,7 @@ # Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights # reserved. -# Copyright (c) 2014-2017 Intel, Inc. All rights reserved. +# Copyright (c) 2014-2018 Intel, Inc. All rights reserved. # Copyright (c) 2014-2018 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. @@ -253,7 +253,8 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ AS_IF([test -z "$with_pmix" || test "$with_pmix" = "yes" || test "$with_pmix" = "internal"], [AC_MSG_RESULT([no]) opal_external_pmix_happy=no - opal_prun_happy=yes], + opal_prun_happy=yes + opal_external_pmix_version=internal], [AC_MSG_RESULT([yes]) # check for external pmix lib */ @@ -272,11 +273,14 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ [AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib64]) files=`ls $with_pmix_libdir/lib64/libpmix.* 2> /dev/null | wc -l` AS_IF([test "$files" -gt 0], - [pmix_ext_install_libdir=$with_pmix_libdir/lib64], - [AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib]) + [AC_MSG_RESULT([found]) + pmix_ext_install_libdir=$with_pmix_libdir/lib64], + [AC_MSG_RESULT([not found]) + AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib]) files=`ls $with_pmix_libdir/lib/libpmix.* 2> /dev/null | wc -l` AS_IF([test "$files" -gt 0], - [pmix_ext_install_libdir=$with_pmix_libdir/lib], + [AC_MSG_RESULT([found]) + pmix_ext_install_libdir=$with_pmix_libdir/lib], [AC_MSG_RESULT([not found]) AC_MSG_ERROR([Cannot continue])])])])], [# check for presence of lib64 directory - if found, see if the @@ -284,11 +288,14 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ AC_MSG_CHECKING([libpmix.* in $pmix_ext_install_dir/lib64]) files=`ls $pmix_ext_install_dir/lib64/libpmix.* 2> /dev/null | wc -l` AS_IF([test "$files" -gt 0], - [pmix_ext_install_libdir=$pmix_ext_install_dir/lib64], - [AC_MSG_CHECKING([libpmix.* in $pmix_ext_install_dir/lib]) + [AC_MSG_RESULT([found]) + pmix_ext_install_libdir=$pmix_ext_install_dir/lib64], + [AC_MSG_RESULT([not found]) + AC_MSG_CHECKING([libpmix.* in $pmix_ext_install_dir/lib]) files=`ls $pmix_ext_install_dir/lib/libpmix.* 2> /dev/null | wc -l` AS_IF([test "$files" -gt 0], - [pmix_ext_install_libdir=$pmix_ext_install_dir/lib], + [AC_MSG_RESULT([found]) + pmix_ext_install_libdir=$pmix_ext_install_dir/lib], [AC_MSG_RESULT([not found]) AC_MSG_ERROR([Cannot continue])])])]) @@ -303,33 +310,22 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ CPPFLAGS="-I$pmix_ext_install_dir/include $CPPFLAGS" AS_IF([test "x`ls $pmix_ext_install_dir/include/pmix_version.h 2> /dev/null`" = "x"], [AC_MSG_RESULT([version file not found - assuming v1.1.4]) - opal_external_pmix_version_found=1 - opal_external_pmix_version=114 - opal_external_have_pmix1=1], + # we don't support anything earlier than 1.2.x + AC_MSG_WARN([External PMIx support requested, but version]) + AC_MSG_WARN([of the external lib is less than the minimum]) + AC_MSG_WARN([v1.2.x required by Open MPI.]) + AC_MSG_ERROR([cannot continue])], [AC_MSG_RESULT([version file found]) opal_external_pmix_version_found=0]) # if it does exist, then we need to parse it to find # the actual release series AS_IF([test "$opal_external_pmix_version_found" = "0"], - [AC_MSG_CHECKING([version 3x]) + [AC_MSG_CHECKING([version 2x or above]) AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ #include - #if (PMIX_VERSION_MAJOR != 3L) - #error "not version 3" - #endif - ], [])], - [AC_MSG_RESULT([found]) - opal_external_pmix_version=3x - opal_external_pmix_version_found=1], - [AC_MSG_RESULT([not found])])]) - - AS_IF([test "$opal_external_pmix_version_found" = "0"], - [AC_MSG_CHECKING([version 2x]) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ - #include - #if (PMIX_VERSION_MAJOR != 2L) - #error "not version 2" + #if (PMIX_VERSION_MAJOR < 2L) + #error "not version 2 or above" #endif ], [])], [AC_MSG_RESULT([found]) @@ -342,8 +338,8 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ [AC_MSG_CHECKING([version 1x]) AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ #include - #if (PMIX_VERSION_MAJOR != 1L) - #error "not version 1" + #if (PMIX_VERSION_MAJOR != 1L && PMIX_VERSION_MINOR != 2L) + #error "not version 1.2.x" #endif ], [])], [AC_MSG_RESULT([found]) @@ -354,8 +350,8 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ AS_IF([test "x$opal_external_pmix_version" = "x"], [AC_MSG_WARN([External PMIx support requested, but version]) - AC_MSG_WARN([information of the external lib could not]) - AC_MSG_WARN([be detected]) + AC_MSG_WARN([of the external lib is less than the minimum]) + AC_MSG_WARN([v1.2.x required by Open MPI]) AC_MSG_ERROR([cannot continue])]) CPPFLAGS=$opal_external_pmix_save_CPPFLAGS @@ -371,5 +367,10 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ AC_DEFINE_UNQUOTED([OPAL_PMIX_V1],[$opal_external_have_pmix1], [Whether the external PMIx library is v1]) AM_CONDITIONAL([OPAL_WANT_PRUN], [test "$opal_prun_happy" = "yes"]) + + AS_IF([test "$opal_external_pmix_version" = "1x"], + [OPAL_SUMMARY_ADD([[Miscellaneous]],[[PMIx support]], [opal_pmix], [1.2.x: WARNING - DYNAMIC OPS NOT SUPPORTED])], + [OPAL_SUMMARY_ADD([[Miscellaneous]],[[PMIx support]], [opal_pmix], [$opal_external_pmix_version])]) + OPAL_VAR_SCOPE_POP ]) diff --git a/opal/mca/pmix/pmix2x/pmix/NEWS b/opal/mca/pmix/pmix2x/pmix/NEWS index 7904bdd8c80..8c1add89935 100644 --- a/opal/mca/pmix/pmix2x/pmix/NEWS +++ b/opal/mca/pmix/pmix2x/pmix/NEWS @@ -21,6 +21,13 @@ example, a bug might be fixed in the master, and then moved to the current release as well as the "stable" bug fix release branch. +2.1.3 -- TBD +---------------------- +- Fixed memory corruption bug in event notification + system due to uninitialized variable +- Add numeric version definition + + 2.1.2 -- 6 July 2018 ---------------------- - Added PMIX_VERSION_RELEASE string to pmix_version.h diff --git a/opal/mca/pmix/pmix2x/pmix/VERSION b/opal/mca/pmix/pmix2x/pmix/VERSION index 61fb5c2aaf8..27af07e5aa5 100644 --- a/opal/mca/pmix/pmix2x/pmix/VERSION +++ b/opal/mca/pmix/pmix2x/pmix/VERSION @@ -15,7 +15,7 @@ major=2 minor=1 -release=2 +release=3 # greek is used for alpha or beta release tags. If it is non-empty, # it will be appended to the version number. It does not have to be @@ -23,14 +23,14 @@ release=2 # The only requirement is that it must be entirely printable ASCII # characters and have no white space. -greek= +greek=rc1 # If repo_rev is empty, then the repository version number will be # obtained during "make dist" via the "git describe --tags --always" # command, or with the date (if "git describe" fails) in the form of # "date". -repo_rev=git8b0bc1f +repo_rev=git1b0b577 # If tarball_version is not empty, it is used as the version string in # the tarball filename, regardless of all other versions listed in @@ -44,7 +44,7 @@ tarball_version= # The date when this release was created -date="Jul 06, 2018" +date="Jul 19, 2018" # The shared library version of each of PMIx's public libraries. # These versions are maintained in accordance with the "Library @@ -75,6 +75,6 @@ date="Jul 06, 2018" # Version numbers are described in the Libtool current:revision:age # format. -libpmix_so_version=3:12:1 +libpmix_so_version=3:13:1 libpmi_so_version=1:0:0 libpmi2_so_version=1:0:0 diff --git a/opal/mca/pmix/pmix2x/pmix/contrib/pmix.spec b/opal/mca/pmix/pmix2x/pmix/contrib/pmix.spec index 1b36ff5488c..853d15a7427 100644 --- a/opal/mca/pmix/pmix2x/pmix/contrib/pmix.spec +++ b/opal/mca/pmix/pmix2x/pmix/contrib/pmix.spec @@ -192,7 +192,7 @@ Summary: An extended/exascale implementation of PMI Name: %{?_name:%{_name}}%{!?_name:pmix} -Version: 2.1.2 +Version: 2.1.3rc1 Release: 1%{?dist} License: BSD Group: Development/Libraries diff --git a/opal/mca/pmix/pmix2x/pmix/include/pmix_version.h.in b/opal/mca/pmix/pmix2x/pmix/include/pmix_version.h.in index a88e3a0c0e3..202a77a85dd 100644 --- a/opal/mca/pmix/pmix2x/pmix/include/pmix_version.h.in +++ b/opal/mca/pmix/pmix2x/pmix/include/pmix_version.h.in @@ -2,6 +2,7 @@ * Copyright (c) 2016 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved. + * Copyright (c) 2018 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -17,4 +18,7 @@ #define PMIX_VERSION_MAJOR @pmixmajor@ #define PMIX_VERSION_MINOR @pmixminor@ #define PMIX_VERSION_RELEASE @pmixrelease@ + +#define PMIX_NUMERIC_VERSION 0x00020103 + #endif diff --git a/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c b/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c index eec17db8171..1065ad0c533 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c +++ b/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c @@ -198,8 +198,8 @@ static pmix_status_t notify_server_of_event(pmix_status_t status, for (n=0; n < cd->ninfo; n++) { PMIX_INFO_XFER(&cd->info[n], &chain->info[n]); if (0 == strncmp(cd->info[n].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) { - cd->nondefault = true; - chain->nondefault = true; + cd->nondefault = PMIX_INFO_TRUE(&info[n]); + chain->nondefault = cd->nondefault; } else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_CUSTOM_RANGE, PMIX_MAX_KEYLEN)) { /* provides an array of pmix_proc_t identifying the procs * that are to receive this notification, or a single pmix_proc_t */ @@ -972,8 +972,8 @@ static void _notify_client_event(int sd, short args, void *cbdata) for (n=0; n < cd->ninfo; n++) { PMIX_INFO_XFER(&chain->info[n], &cd->info[n]); if (0 == strncmp(cd->info[n].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) { - cd->nondefault = true; - chain->nondefault = true; + cd->nondefault = PMIX_INFO_TRUE(&cd->info[n]); + chain->nondefault = cd->nondefault; } else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_CUSTOM_RANGE, PMIX_MAX_KEYLEN)) { /* provides an array of pmix_proc_t identifying the procs * that are to receive this notification, or a single pmix_proc_t */ @@ -1087,7 +1087,7 @@ pmix_status_t pmix_server_notify_client_of_event(pmix_status_t status, if (NULL != info) { for (n=0; n < ninfo; n++) { if (0 == strncmp(info[n].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) { - cd->nondefault = true; + cd->nondefault = PMIX_INFO_TRUE(&info[n]); } else if (0 == strncmp(info[n].key, PMIX_EVENT_CUSTOM_RANGE, PMIX_MAX_KEYLEN)) { /* provides an array of pmix_proc_t identifying the procs * that are to receive this notification, or a single pmix_proc_t */ diff --git a/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c b/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c index 248dd4bf0e3..b2f187c9166 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c +++ b/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -391,11 +391,11 @@ static void check_cached_events(pmix_rshift_caddy_t *cd) chain->status = ncd->status; (void)strncpy(chain->source.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN); chain->source.rank = pmix_globals.myid.rank; - /* we already left space for evhandler name plus - * a callback object when we cached the notification */ - chain->ninfo = ncd->ninfo; - PMIX_INFO_CREATE(chain->info, chain->ninfo); + /* we always leave space for event hdlr name and a callback object */ + chain->nallocated = ncd->ninfo + 2; + PMIX_INFO_CREATE(chain->info, chain->nallocated); if (0 < cd->ninfo) { + chain->ninfo = ncd->ninfo; /* need to copy the info */ for (n=0; n < ncd->ninfo; n++) { PMIX_INFO_XFER(&chain->info[n], &ncd->info[n]); diff --git a/opal/mca/pmix/pmix2x/pmix2x.c b/opal/mca/pmix/pmix2x/pmix2x.c index c725cd307d2..a00a6e63286 100644 --- a/opal/mca/pmix/pmix2x/pmix2x.c +++ b/opal/mca/pmix/pmix2x/pmix2x.c @@ -317,13 +317,16 @@ void pmix2x_event_hdlr(size_t evhdlr_registration_id, } /* convert the array of info */ - if (NULL != info) { + if (NULL != info && 0 < ninfo) { cd->info = OBJ_NEW(opal_list_t); for (n=0; n < ninfo; n++) { iptr = OBJ_NEW(opal_value_t); + /* ensure that this key is NULL terminated */ + info[n].key[PMIX_MAX_KEYLEN] = '\0'; iptr->key = strdup(info[n].key); if (OPAL_SUCCESS != (rc = pmix2x_value_unload(iptr, &info[n].value))) { OPAL_ERROR_LOG(rc); + opal_output(0, "KEY %s FAILED VALUE TRANSLATION", info[n].key); OBJ_RELEASE(iptr); continue; } @@ -332,7 +335,7 @@ void pmix2x_event_hdlr(size_t evhdlr_registration_id, } /* convert the array of prior results */ - if (NULL != results) { + if (NULL != results && 0 < nresults) { for (n=0; n < nresults; n++) { iptr = OBJ_NEW(opal_value_t); iptr->key = strdup(results[n].key); diff --git a/orte/orted/pmix/pmix_server_gen.c b/orte/orted/pmix/pmix_server_gen.c index 633eb5de7ed..3563e00594f 100644 --- a/orte/orted/pmix/pmix_server_gen.c +++ b/orte/orted/pmix/pmix_server_gen.c @@ -356,6 +356,17 @@ void pmix_server_notify(int status, orte_process_name_t* sender, } } + /* protect against infinite loops by marking that this notification was + * passed down to the server by me */ + if (NULL == cd->info) { + cd->info = OBJ_NEW(opal_list_t); + } + val = OBJ_NEW(opal_value_t); + val->key = strdup("orte.notify.donotloop"); + val->type = OPAL_BOOL; + val->data.flag = true; + opal_list_append(cd->info, &val->super); + opal_output_verbose(2, orte_pmix_server_globals.output, "%s NOTIFYING PMIX SERVER OF STATUS %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ret); @@ -382,6 +393,14 @@ int pmix_server_notify_event(int code, opal_process_name_t *source, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(source), code); + /* check to see if this is one we sent down */ + OPAL_LIST_FOREACH(val, info, opal_value_t) { + if (0 == strcmp(val->key, "orte.notify.donotloop")) { + /* yep - do not process */ + goto done; + } + } + /* a local process has generated an event - we need to xcast it * to all the daemons so it can be passed down to their local * procs */ @@ -448,6 +467,7 @@ int pmix_server_notify_event(int code, opal_process_name_t *source, /* maintain accounting */ OBJ_RELEASE(sig); + done: /* execute the callback */ if (NULL != cbfunc) { cbfunc(ORTE_SUCCESS, cbdata);