From 4a4de9d2d6b49e6768641368929eeea457a02854 Mon Sep 17 00:00:00 2001 From: Philip Kovacs Date: Sat, 13 Jul 2019 02:48:25 -0400 Subject: [PATCH] add test suite patches Signed-off-by: Philip Kovacs --- pmix.spec | 7 ++++- pmix_pointer_casts_1.patch | 59 ++++++++++++++++++++++++++++++++++++++ pmix_pointer_casts_2.patch | 13 +++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 pmix_pointer_casts_1.patch create mode 100644 pmix_pointer_casts_2.patch diff --git a/pmix.spec b/pmix.spec index 568cf3d..a037cd8 100644 --- a/pmix.spec +++ b/pmix.spec @@ -8,6 +8,9 @@ Source0: https://github.com/pmix/%{name}/releases/download/v%{version}/%{ # Remove configure check for C++ since requires only C Patch0: pmix_remove_cxx_lang.patch +# Fix pointer casts/derefs in test suite +Patch1: pmix_pointer_casts_1.patch +Patch2: pmix_pointer_casts_2.patch BuildRequires: autoconf BuildRequires: automake @@ -58,6 +61,8 @@ based starters (e.g., mpirun). %prep %setup -q -n %{name}-%{version} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 echo touching lexer sources to recompile them ... find src -name \*.l -print -exec touch --no-create {} \; @@ -153,7 +158,7 @@ EOF %{_bindir}/* %changelog -* Fri Jul 5 2019 Philip Kovacs - 3.1.3-1 +* Sat Jul 13 2019 Philip Kovacs - 3.1.3-1 - Update to 3.1.3 * Tue Jul 2 2019 Philip Kovacs - 3.1.2-2 diff --git a/pmix_pointer_casts_1.patch b/pmix_pointer_casts_1.patch new file mode 100644 index 0000000..78620ac --- /dev/null +++ b/pmix_pointer_casts_1.patch @@ -0,0 +1,59 @@ +commit 3a7defdec3049b204e602f6fd9d5c5a71bf1df7d +Author: Philip Kovacs +Date: Tue Jul 9 02:25:53 2019 -0400 + + fix incorrect pointer casts/derefs + + Signed-off-by: Philip Kovacs + +diff --git a/test/test_server.c b/test/test_server.c +index aa897fb5..d0ab53ce 100644 +--- a/test/test_server.c ++++ b/test/test_server.c +@@ -187,7 +187,7 @@ static void server_unpack_procs(char *buf, size_t size) + char *nspace; + + while ((size_t)(ptr - buf) < size) { +- ns_count = (size_t)*ptr; ++ ns_count = *(size_t *)ptr; + ptr += sizeof(size_t); + + for (i = 0; i < ns_count; i++) { +@@ -201,10 +201,10 @@ static void server_unpack_procs(char *buf, size_t size) + nspace = ptr; + ptr += PMIX_MAX_NSLEN+1; + +- ntasks = (size_t)*ptr; ++ ntasks = *(size_t *)ptr; + ptr += sizeof(size_t); + +- ltasks = (size_t)*ptr; ++ ltasks = *(size_t *)ptr; + ptr += sizeof(size_t); + + PMIX_LIST_FOREACH(tmp, server_nspace, server_nspace_t) { +@@ -226,7 +226,7 @@ static void server_unpack_procs(char *buf, size_t size) + } + size_t i; + for (i = 0; i < ltasks; i++) { +- int rank = (int)*ptr; ++ int rank = *(int *)ptr; + ptr += sizeof(int); + if (ns_item->task_map[rank] >= 0) { + continue; +@@ -651,13 +651,13 @@ static void server_unpack_dmdx(char *buf, int *sender, pmix_proc_t *proc) + { + char *ptr = buf; + +- *sender = (int)*ptr; ++ *sender = *(int *)ptr; + ptr += sizeof(int); + + memcpy(proc->nspace, ptr, PMIX_MAX_NSLEN +1); + ptr += PMIX_MAX_NSLEN +1; + +- proc->rank = (int)*ptr; ++ proc->rank = *(int *)ptr; + ptr += sizeof(int); + } + diff --git a/pmix_pointer_casts_2.patch b/pmix_pointer_casts_2.patch new file mode 100644 index 0000000..926a03e --- /dev/null +++ b/pmix_pointer_casts_2.patch @@ -0,0 +1,13 @@ +diff --git a/test/test_server.c b/test/test_server.c +index 981a6604..ee91afd9 100644 +--- a/test/test_server.c ++++ b/test/test_server.c +@@ -195,7 +195,7 @@ static void server_unpack_procs(char *buf, size_t size) + size_t ltasks, ntasks; + int server_id; + +- server_id = *ptr; ++ server_id = *(int *)ptr; + ptr += sizeof(int); + + nspace = ptr;