From 3964144ca55dd506f280cba97debb05851cdc311 Mon Sep 17 00:00:00 2001 From: Maxwell Coil Date: Sun, 10 Nov 2019 14:58:55 -0500 Subject: [PATCH 1/5] Fix misleading error message with missing #! interpreter This change fixes the misleading error message. I added a conditional to determine whether the error is due to a missing file or a bad interpreter. If it is the latter, a new, more precise error message will be displayed. Fixes #4528 Signed-off-by: Maxwell Coil (cherry picked from commit 9b73f6ac83b1efd6db60d71a6e0a4c83b52af0aa) --- orte/mca/odls/default/odls_default_module.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/orte/mca/odls/default/odls_default_module.c b/orte/mca/odls/default/odls_default_module.c index ab9d6e442f..f8012bb3c9 100644 --- a/orte/mca/odls/default/odls_default_module.c +++ b/orte/mca/odls/default/odls_default_module.c @@ -454,11 +454,22 @@ static int do_child(orte_odls_spawn_caddy_t *cd, int write_fd) /* Exec the new executable */ execve(cd->cmd, cd->argv, cd->env); - getcwd(dir, sizeof(dir)); + /* If we get here, an error has occurred. */ + (void) getcwd(dir, sizeof(dir)); + struct stat stats; + char* msg; + /* If errno is ENOENT, that indicates either cd->cmd does not exist, or + * cd->cmd is a script, but has a bad interpreter specified. */ + if (ENOENT == errno && 0 == stat(cd->app->app, &stats)) { + asprintf(&msg, "%s has a bad interpreter on the first line.", + cd->app->app); + } else { + msg = strdup(strerror(errno)); + } send_error_show_help(write_fd, 1, "help-orte-odls-default.txt", "execve error", - orte_process_info.nodename, dir, cd->app->app, strerror(errno)); - /* Does not return */ + orte_process_info.nodename, dir, cd->app->app, msg); + free(msg); } From 879a25c239e1c45bb255156497f995af23b921cf Mon Sep 17 00:00:00 2001 From: Maxwell Coil Date: Mon, 2 Dec 2019 17:52:06 -0500 Subject: [PATCH 2/5] ompi/dpm/dpm.c: Fix uninititalized variable Squash compiler warning. Signed-off-by: Maxwell Coil (cherry picked from commit 3ced33c2ebf403206c242c89bb70b6b9a0fc8968) --- ompi/dpm/dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ompi/dpm/dpm.c b/ompi/dpm/dpm.c index 9fb42dcce0..435b5ce96e 100644 --- a/ompi/dpm/dpm.c +++ b/ompi/dpm/dpm.c @@ -405,7 +405,7 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, } if (0 < opal_list_get_size(&ilist)) { uint32_t *peer_ranks = NULL; - int prn, nprn; + int prn, nprn = 0; char *val, *mycpuset; uint16_t u16; opal_process_name_t wildcard_rank; From 84a67bd6cfa5d40e212f999adf425bcf06a2e16e Mon Sep 17 00:00:00 2001 From: Maxwell Coil Date: Mon, 2 Dec 2019 17:53:15 -0500 Subject: [PATCH 3/5] libnbc: fixed uninitialized variable Squash compiler warning. Signed-off-by: Maxwell Coil (cherry picked from commit 52241dbbcdcbf3605c8098d0cfbcf3c5a75a1c9c) --- ompi/mca/coll/libnbc/nbc_ialltoall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ompi/mca/coll/libnbc/nbc_ialltoall.c b/ompi/mca/coll/libnbc/nbc_ialltoall.c index e2731e1a1d..6c5883f23c 100644 --- a/ompi/mca/coll/libnbc/nbc_ialltoall.c +++ b/ompi/mca/coll/libnbc/nbc_ialltoall.c @@ -70,7 +70,7 @@ static int nbc_alltoall_init(const void* sendbuf, int sendcount, MPI_Datatype se enum {NBC_A2A_LINEAR, NBC_A2A_PAIRWISE, NBC_A2A_DISS, NBC_A2A_INPLACE} alg; void *tmpbuf = NULL; ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module; - ptrdiff_t span, gap; + ptrdiff_t span, gap = 0; NBC_IN_PLACE(sendbuf, recvbuf, inplace); From 6fdd902d3ffcf650c7353f398986efebde50be47 Mon Sep 17 00:00:00 2001 From: Maxwell Coil Date: Thu, 5 Dec 2019 18:24:02 -0500 Subject: [PATCH 4/5] romio: Update ADIOI_R_Exchange_data function Squash compiler warning due to whitespace/brace problems. The code block from lines 829-839 was improperly indented, which led to both the code being confusing and a compiler warning. Comparing this code to the current version in the MPICH repo made it clear that the code was simply improperly indented. Fixing the indentation both makes the code readable and squashes the compiler warning. Signed-off-by: Maxwell Coil (cherry picked from commit 8c237e268472a763ad4aa55e24d25ee7ca64b888) --- .../romio321/romio/adio/common/ad_read_coll.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ompi/mca/io/romio321/romio/adio/common/ad_read_coll.c b/ompi/mca/io/romio321/romio/adio/common/ad_read_coll.c index 11e657b7e3..d81ba2d3c4 100644 --- a/ompi/mca/io/romio321/romio/adio/common/ad_read_coll.c +++ b/ompi/mca/io/romio321/romio/adio/common/ad_read_coll.c @@ -826,17 +826,17 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node if (recv_size[i]) recv_buf[i] = (char *) ADIOI_Malloc(recv_size[i]); - j = 0; - for (i=0; i < nprocs; i++) - if (recv_size[i]) { - MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i, - myrank+i+100*iter, fd->comm, requests+j); - j++; + j = 0; + for (i=0; i < nprocs; i++) + if (recv_size[i]) { + MPI_Irecv(recv_buf[i], recv_size[i], MPI_BYTE, i, + myrank+i+100*iter, fd->comm, requests+j); + j++; #ifdef RDCOLL_DEBUG - DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n", - myrank, recv_size[i], myrank+i+100*iter); + DBG_FPRINTF(stderr, "node %d, recv_size %d, tag %d \n", + myrank, recv_size[i], myrank+i+100*iter); #endif - } + } } /* create derived datatypes and send data */ From 07a54b7025fbc8fa745d55e5c3a66c56a62cdb14 Mon Sep 17 00:00:00 2001 From: Maxwell Coil Date: Sun, 8 Dec 2019 13:56:00 -0500 Subject: [PATCH 5/5] memory/patcher: fix compiler warning syscall() returns a long, but we are invoking shmat(), which returns a void*. Signed-off-by: Maxwell Coil (cherry picked from commit 52a9cce6f3dcd87e9ae66177398b60b9317e9339) --- opal/mca/memory/patcher/memory_patcher_component.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opal/mca/memory/patcher/memory_patcher_component.c b/opal/mca/memory/patcher/memory_patcher_component.c index 687d430fa3..272ec72122 100644 --- a/opal/mca/memory/patcher/memory_patcher_component.c +++ b/opal/mca/memory/patcher/memory_patcher_component.c @@ -440,7 +440,7 @@ static void *_intercept_shmat(int shmid, const void *shmaddr, int shmflg) if (!original_shmat) { #if defined(SYS_shmat) - result = memory_patcher_syscall(SYS_shmat, shmid, shmaddr, shmflg); + result = (void*) memory_patcher_syscall(SYS_shmat, shmid, shmaddr, shmflg); #else // IPCOP_shmat unsigned long ret; ret = memory_patcher_syscall(SYS_ipc, IPCOP_shmat,