Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit c2d3f77

Browse files
authored
Merge pull request #1337 from rhc54/cmr201/pmixup
Update PMIx to the latest 1.1.5rc to catch the strnlen abstraction support required for working on older Mac's
2 parents 9761a72 + acf4e51 commit c2d3f77

File tree

7 files changed

+74
-29
lines changed

7 files changed

+74
-29
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ opal/mca/pmix/pmix112/pmix/include/pmix/autogen/config.h.in
305305
opal/mca/pmix/pmix112/pmix/include/pmix/pmix_common.h
306306
opal/mca/pmix/pmix112/pmix/include/private/autogen/config.h
307307
opal/mca/pmix/pmix112/pmix/include/private/autogen/config.h.in
308+
opal/mca/pmix/pmix112/pmix/include/pmix/autogen/config.h.in
308309

309310
opal/tools/opal-checkpoint/opal-checkpoint
310311
opal/tools/opal-checkpoint/opal-checkpoint.1

opal/mca/pmix/pmix112/pmix/Makefile.am

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ EXTRA_DIST =
3131
# Only install the valgrind suppressions file if we're building in
3232
# standalone mode
3333
dist_pmixdata_DATA =
34-
3534
if ! PMIX_EMBEDDED_MODE
3635
dist_pmixdata_DATA += contrib/pmix-valgrind.supp
3736

@@ -46,7 +45,6 @@ man_MANS = \
4645
man/man3/pmix_get.3 \
4746
man/man7/pmix.7 \
4847
man/man7/pmix_constants.7
49-
5048
endif
5149

5250
include config/Makefile.am
@@ -91,15 +89,12 @@ nroff:
9189

9290
EXTRA_DIST += README INSTALL VERSION LICENSE autogen.sh \
9391
config/pmix_get_version.sh $(man_MANS) \
94-
contrib/platform/optimized
92+
contrib/platform/optimized \
93+
test/test_common.h test/cli_stages.h \
94+
test/server_callbacks.h test/test_fence.h \
95+
test/test_publish.h test/test_resolve_peers.h \
96+
test/test_spawn.h test/utils.h test/test_cd.h
9597

96-
if ! PMIX_EMBEDDED_MODE
97-
98-
EXTRA_DIST += test/test_common.h test/cli_stages.h \
99-
test/server_callbacks.h test/test_fence.h \
100-
test/test_publish.h test/test_resolve_peers.h \
101-
test/test_spawn.h test/utils.h test/test_cd.h
102-
endif
10398

10499
dist-hook:
105100
env LS_COLORS= sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(PMIX_VERSION)" "$(PMIX_REPO_REV)"

opal/mca/pmix/pmix112/pmix/VERSION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515

1616
major=1
1717
minor=1
18-
release=4
18+
release=5
1919

2020
# greek is used for alpha or beta release tags. If it is non-empty,
2121
# it will be appended to the version number. It does not have to be
2222
# numeric. Common examples include a1 (alpha release 1), b1 or (beta release 1).
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=git4695e45
33+
repo_rev=git9ae61b8
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="Jun 01, 2016"
47+
date="Aug 23, 2016"
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/pmix112/pmix/config/pmix.m4

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights
1717
dnl reserved.
1818
dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved.
1919
dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
20-
dnl Copyright (c) 2013-2015 Intel, Inc. All rights reserved
2120
dnl Copyright (c) 2015-2016 Research Organization for Information Science
22-
dnl and Technology (RIST). All rights reserved.
21+
dnl Copyright (c) 2013-2016 Intel, Inc. All rights reserved
2322
dnl Copyright (c) 2016 Mellanox Technologies, Inc.
2423
dnl All rights reserved.
2524
dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
@@ -496,7 +495,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
496495
# Darwin doesn't need -lm, as it's a symlink to libSystem.dylib
497496
PMIX_SEARCH_LIBS_CORE([ceil], [m])
498497

499-
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep getpeereid getpeerucred])
498+
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep getpeereid getpeerucred strnlen])
500499

501500
# On some hosts, htonl is a define, so the AC_CHECK_FUNC will get
502501
# confused. On others, it's in the standard library, but stubbed with

opal/mca/pmix/pmix112/pmix/src/server/pmix_server_listener.c

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
4-
* Copyright (c) 2014-2015 Research Organization for Information Science
4+
* Copyright (c) 2014-2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014-2015 Artem Y. Polyakov <[email protected]>.
77
* All rights reserved.
@@ -56,6 +56,7 @@
5656
#include "src/util/output.h"
5757
#include "src/util/pmix_environ.h"
5858
#include "src/util/progress_threads.h"
59+
#include "src/util/strnlen.h"
5960
#include "src/usock/usock.h"
6061
#include "src/sec/pmix_sec.h"
6162

@@ -315,31 +316,41 @@ static pmix_status_t parse_connect_ack (char *msg, int len,
315316
char **nspace, int *rank,
316317
char **version, char **cred)
317318
{
318-
if ((int)strnlen (msg, len) < len) {
319+
int msglen;
320+
321+
PMIX_STRNLEN(msglen, msg, len);
322+
if (msglen < len) {
319323
*nspace = msg;
320324
msg += strlen(*nspace) + 1;
321325
len -= strlen(*nspace) + 1;
322-
} else
326+
} else {
323327
return PMIX_ERR_BAD_PARAM;
328+
}
324329

325-
if ((int)sizeof(int) <= len) {
326-
*rank = *(int *)msg;
330+
PMIX_STRNLEN(msglen, msg, len);
331+
if (msglen <= len) {
332+
memcpy(rank, msg, sizeof(int));
327333
msg += sizeof(int);
328334
len -= sizeof(int);
329-
} else
335+
} else {
330336
return PMIX_ERR_BAD_PARAM;
337+
}
331338

332-
if ((int)strnlen (msg, len) < len) {
339+
PMIX_STRNLEN(msglen, msg, len);
340+
if (msglen < len) {
333341
*version = msg;
334342
msg += strlen(*version) + 1;
335343
len -= strlen(*version) + 1;
336-
} else
344+
} else {
337345
return PMIX_ERR_BAD_PARAM;
346+
}
338347

339-
if ((int)strnlen (msg, len) < len)
348+
PMIX_STRNLEN(msglen, msg, len);
349+
if (msglen < len)
340350
*cred = msg;
341-
else
351+
else {
342352
*cred = NULL;
353+
}
343354

344355
return PMIX_SUCCESS;
345356
}

opal/mca/pmix/pmix112/pmix/src/util/Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
1313
# Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
1414
# Copyright (c) 2013 Intel, Inc. All rights reserved
15-
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved
15+
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
1616
# $COPYRIGHT$
1717
#
1818
# Additional copyrights may follow
@@ -34,7 +34,8 @@ headers += \
3434
src/util/timings.h \
3535
src/util/os_path.h \
3636
src/util/basename.h \
37-
src/util/hash.h
37+
src/util/hash.h \
38+
src/util/strnlen.h
3839

3940
sources += \
4041
src/util/argv.c \
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
3+
* $COPYRIGHT$
4+
*
5+
* Additional copyrights may follow
6+
*
7+
* $HEADER$
8+
*/
9+
10+
/** @file
11+
*
12+
* Buffer strnlen function for portability to archaic platforms.
13+
*/
14+
15+
#ifndef PMIX_STRNLEN_H
16+
#define PMIX_STRNLEN_H
17+
18+
#include <src/include/pmix_config.h>
19+
20+
#if defined(HAVE_STRNLEN)
21+
#define PMIX_STRNLEN(c, a, b) \
22+
(c) = (int)strnlen(a, b)
23+
#else
24+
#define PMIX_STRNLEN(c, a, b) \
25+
do { \
26+
int _x; \
27+
(c) = 0; \
28+
for (_x=0; _x < (b); _x++) { \
29+
if ('\0' == (a)[_x]) { \
30+
break; \
31+
} \
32+
++(c); \
33+
} \
34+
} while(0)
35+
#endif
36+
37+
#endif /* PMIX_STRNLEN_H */
38+

0 commit comments

Comments
 (0)