Skip to content

Commit 0c8609c

Browse files
author
Ralph Castain
committed
Update to newest PMIx master (includes configuration cleanups). Silence trivial Coverity warning in hwloc base.
Cleanup a race condition segfault during finalize by ensuring the PMIx progress thread is stopped prior to starting to tear down the messaging components Signed-off-by: Ralph Castain <[email protected]>
1 parent 9ecfbba commit 0c8609c

File tree

10 files changed

+58
-45
lines changed

10 files changed

+58
-45
lines changed

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,6 +2232,9 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo,
22322232

22332233
/* get the width of the topology at this depth */
22342234
width = hwloc_get_nbobjs_by_depth(topo, d);
2235+
if (0 == width) {
2236+
continue;
2237+
}
22352238

22362239
/* scan all objects at this depth to see if
22372240
* the location overlaps with them

opal/mca/pmix/pmix2x/configure.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ AC_DEFUN([MCA_opal_pmix_pmix2x_CONFIG],[
4949
opal_pmix_pmix2x_sm_flag=--disable-dstore
5050
fi
5151

52-
opal_pmix_pmix2x_args="--with-pmix-symbol-rename=OPAL_MCA_PMIX2X_ $opal_pmix_pmix2x_sm_flag --without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\""
52+
opal_pmix_pmix2x_args="--enable-embedded-mode --with-pmix-symbol-rename=OPAL_MCA_PMIX2X_ $opal_pmix_pmix2x_sm_flag --without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\""
5353
AS_IF([test "$enable_debug" = "yes"],
5454
[opal_pmix_pmix2x_args="--enable-debug $opal_pmix_pmix2x_args"
5555
CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"],
5656
[opal_pmix_pmix2x_args="--disable-debug $opal_pmix_pmix2x_args"
5757
CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS"])
5858
AS_IF([test "$with_devel_headers" = "yes"], [],
59-
[opal_pmix_pmix2x_args="--enable-embedded-mode $opal_pmix_pmix2x_args"])
59+
[opal_pmix_pmix2x_args="--with-devel-headers $opal_pmix_pmix2x_args"])
6060
CPPFLAGS="-I$OPAL_TOP_SRCDIR -I$OPAL_TOP_BUILDDIR -I$OPAL_TOP_SRCDIR/opal/include -I$OPAL_TOP_BUILDDIR/opal/include $CPPFLAGS"
6161

6262
OPAL_CONFIG_SUBDIR([$opal_pmix_pmix2x_basedir/pmix],

opal/mca/pmix/pmix2x/pmix/VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ release=0
2323
# The only requirement is that it must be entirely printable ASCII
2424
# characters and have no white space.
2525

26-
greek=
26+
greek=a1
2727

2828
# If repo_rev is empty, then the repository version number will be
2929
# obtained during "make dist" via the "git describe --tags --always"
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=gitbf86f3a
33+
repo_rev=git3b5c9b7
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Feb 13, 2017"
47+
date="Feb 14, 2017"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix2x/pmix/config/pmix.m4

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -746,21 +746,12 @@ AC_DEFUN([PMIX_DEFINE_ARGS],[
746746
[Using --enable-embedded-mode causes PMIx to skip a few configure checks and install nothing. It should only be used when building PMIx within the scope of a larger package.])])
747747
AS_IF([test ! -z "$enable_embedded_mode" && test "$enable_embedded_mode" = "yes"],
748748
[pmix_mode=embedded
749+
pmix_install_primary_headers=no
749750
AC_MSG_RESULT([yes])],
750751
[pmix_mode=standalone
752+
pmix_install_primary_headers=yes
751753
AC_MSG_RESULT([no])])
752754

753-
# Install tests and examples?
754-
AC_MSG_CHECKING([if tests and examples are to be installed])
755-
AC_ARG_WITH([tests-examples],
756-
[AC_HELP_STRING([--with-tests-examples],
757-
[Whether or not to install the tests and example programs.])])
758-
AS_IF([test ! -z "$with_tests_examples" && test "$with_tests_examples" = "no"],
759-
[pmix_tests=no
760-
AC_MSG_RESULT([no])],
761-
[pmix_tests=yes
762-
AC_MSG_RESULT([yes])])
763-
764755
#
765756
# Is this a developer copy?
766757
#
@@ -836,11 +827,31 @@ AC_ARG_WITH(devel-headers,
836827
if test "$with_devel_headers" = "yes"; then
837828
AC_MSG_RESULT([yes])
838829
WANT_INSTALL_HEADERS=1
830+
pmix_install_primary_headers=yes
839831
else
840832
AC_MSG_RESULT([no])
841833
WANT_INSTALL_HEADERS=0
842834
fi
843-
AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1)
835+
836+
# Install tests and examples?
837+
AC_MSG_CHECKING([if tests and examples are to be installed])
838+
AC_ARG_WITH([tests-examples],
839+
[AC_HELP_STRING([--with-tests-examples],
840+
[Whether or not to install the tests and example programs.])])
841+
AS_IF([test "$pmix_install_primary_headers" = "no"],
842+
[AS_IF([test -z "$with_tests_examples" || test "$with_tests_examples" = "no"],
843+
[pmix_tests=no
844+
AC_MSG_RESULT([no])],
845+
[AC_MSG_RESULT([no])
846+
AC_MSG_WARN([Cannot install tests/examples without installing primary headers.])
847+
AC_MSG_WARN([This situation arises when configured in embedded mode])
848+
AC_MSG_WARN([and without devel headers.])
849+
AC_MSG_ERROR([Please correct the configure line and retry])])],
850+
[AS_IF([test ! -z "$with_tests_examples" && test "$with_tests_examples" = "no"],
851+
[pmix_tests=no
852+
AC_MSG_RESULT([no])],
853+
[pmix_tests=yes
854+
AC_MSG_RESULT([yes])])])
844855

845856
#
846857
# Support per-user config files?
@@ -979,7 +990,9 @@ AC_DEFUN([PMIX_DO_AM_CONDITIONALS],[
979990
AM_CONDITIONAL([PMIX_COMPILE_TIMING], [test "$WANT_TIMING" = "1"])
980991
AM_CONDITIONAL([PMIX_WANT_MUNGE], [test "$pmix_munge_support" = "1"])
981992
AM_CONDITIONAL([PMIX_WANT_SASL], [test "$pmix_sasl_support" = "1"])
982-
AM_CONDITIONAL([WANT_DSTORE],[test "x$enable_dstore" != "xno"])
993+
AM_CONDITIONAL([WANT_DSTORE], [test "x$enable_dstore" != "xno"])
994+
AM_CONDITIONAL([WANT_PRIMARY_HEADERS], [test "x$pmix_install_primary_headers" = "xyes"])
995+
AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1)
983996
])
984997
pmix_did_am_conditionals=yes
985998
])dnl

opal/mca/pmix/pmix2x/pmix/include/Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2015-2016 Intel, Inc. All rights reserved
2+
# Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
33
#
44
# $COPYRIGHT$
55
#
@@ -10,7 +10,7 @@
1010

1111
# Only install the headers if we're in standalone mode
1212

13-
if ! PMIX_EMBEDDED_MODE
13+
if WANT_PRIMARY_HEADERS
1414
include_HEADERS = \
1515
pmix.h \
1616
pmix_common.h \
@@ -23,4 +23,4 @@ nodist_include_HEADERS = \
2323
pmix_version.h \
2424
pmix_rename.h
2525

26-
endif ! PMIX_EMBEDDED_MODE
26+
endif

opal/mca/pmix/pmix2x/pmix/src/client/pmix_client.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -236,21 +236,6 @@ static void evhandler_reg_callbk(pmix_status_t status,
236236
*active = status;
237237
}
238238

239-
static void _destruct_my_server_fn(int sd, short args, void *cbdata)
240-
{
241-
pmix_cb_t *cb= (pmix_cb_t *)cbdata;
242-
PMIX_DESTRUCT(&pmix_client_globals.myserver);
243-
cb->active = false;
244-
}
245-
246-
247-
static void pmix_destruct_my_server(void)
248-
{
249-
pmix_cb_t cb;
250-
PMIX_THREADSHIFT(&cb, _destruct_my_server_fn);
251-
PMIX_WAIT_FOR_COMPLETION(cb.active);
252-
}
253-
254239
PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
255240
pmix_info_t info[], size_t ninfo)
256241
{
@@ -473,7 +458,12 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
473458
"pmix:client finalize sync received");
474459
}
475460

476-
pmix_destruct_my_server();
461+
if (!pmix_globals.external_evbase) {
462+
/* stop the progress thread */
463+
(void)pmix_progress_thread_stop(NULL);
464+
}
465+
466+
PMIX_DESTRUCT(&pmix_client_globals.myserver);
477467

478468
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
479469
if (0 > (rc = pmix_dstore_nspace_del(pmix_globals.myid.nspace))) {

opal/mca/pmix/pmix2x/pmix/src/runtime/pmix_finalize.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
1414
* All rights reserved.
15-
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved
15+
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
1616
* Copyright (c) 2016 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* $COPYRIGHT$
@@ -68,11 +68,6 @@ void pmix_rte_finalize(void)
6868
return;
6969
}
7070

71-
if (!pmix_globals.external_evbase) {
72-
/* stop the progress thread */
73-
(void)pmix_progress_thread_stop(NULL);
74-
}
75-
7671
/* cleanup communications */
7772
(void)pmix_mca_base_framework_close(&pmix_ptl_base_framework);
7873
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)

opal/mca/pmix/pmix2x/pmix/src/server/pmix_server.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ PMIX_EXPORT pmix_status_t PMIx_server_finalize(void)
268268
pmix_output_verbose(2, pmix_globals.debug_output,
269269
"pmix:server finalize called");
270270

271+
if (!pmix_globals.external_evbase) {
272+
/* stop the progress thread */
273+
(void)pmix_progress_thread_stop(NULL);
274+
}
275+
271276
pmix_ptl_base_stop_listening();
272277

273278
cleanup_server_state();

opal/mca/pmix/pmix2x/pmix/src/server/pmix_server_ops.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,9 @@ static void lmcon(pmix_dmdx_local_t *p)
16361636
}
16371637
static void lmdes(pmix_dmdx_local_t *p)
16381638
{
1639-
PMIX_INFO_FREE(p->info, p->ninfo);
1639+
if (NULL != p->info) {
1640+
PMIX_INFO_FREE(p->info, p->ninfo);
1641+
}
16401642
PMIX_LIST_DESTRUCT(&p->loc_reqs);
16411643
}
16421644
PMIX_CLASS_INSTANCE(pmix_dmdx_local_t,

opal/mca/pmix/pmix2x/pmix/src/tool/pmix_tool.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
44
* Copyright (c) 2014-2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014 Artem Y. Polyakov <[email protected]>.
@@ -517,6 +517,11 @@ PMIX_EXPORT pmix_status_t PMIx_tool_finalize(void)
517517
pmix_output_verbose(2, pmix_globals.debug_output,
518518
"pmix:tool finalize sync received");
519519

520+
if (!pmix_globals.external_evbase) {
521+
/* stop the progress thread */
522+
(void)pmix_progress_thread_stop(NULL);
523+
}
524+
520525
/* shutdown services */
521526
pmix_rte_finalize();
522527

0 commit comments

Comments
 (0)