open-mpi / ompi

Open MPI main development repository
https://www.open-mpi.org
Other
2.16k stars 858 forks source link

memory/patcher selected also when all tests fail #4282

Open matzeri opened 7 years ago

matzeri commented 7 years ago

Version 2.1.2 The configuration test at opal/mca/memory/patcher/configure.m4 is incomplete and the patcher is selected also when all tests fail

configure:122388: checking for __curbrk
/usr/src/debug/openmpi-2.1.2-0.3/conftest.c:691: undefined reference to `__curbrk'
configure:122388: $? = 1
configure:122388: result: no

configure:122401: checking linux/mman.h usability
conftest.c:690:24: fatal error: linux/mman.h: No such file or directory
configure:122401: result: no
configure:122401: checking for linux/mman.h
configure:122401: result: no

configure:122452: checking for __syscall
configure:122452: result: no

configure:122496: checking if MCA component memory:patcher can compile
configure:122498: result: yes
jsquyres commented 7 years ago

@matzeri also posted more on the thread here: https://www.mail-archive.com/devel@lists.open-mpi.org/msg20390.html

@ggouaillardet sent a patch on 31 Oct 2017 to see if it would help:

diff -ruN orig/openmpi-2.1.2/opal/mca/memory/patcher/memory_patcher_component.c openmpi-2.1.2/opal/mca/memory/patcher/memory_patcher_component.c
--- orig/openmpi-2.1.2/opal/mca/memory/patcher/memory_patcher_component.c   2017-08-11 01:15:56.000000000 +0900
+++ openmpi-2.1.2/opal/mca/memory/patcher/memory_patcher_component.c    2017-10-31 16:36:21.266989000 +0900
@@ -152,6 +152,7 @@

 #endif

+#if defined (SYS_munmap)
 static int (*original_munmap) (void *, size_t);

 static int _intercept_munmap(void *start, size_t length)
@@ -177,6 +178,7 @@
     OPAL_PATCHER_END;
     return result;
 }
+#endif

 #if defined (SYS_mremap)

@@ -484,10 +486,12 @@
     }
 #endif

+#if defined (SYS_munmap)
     rc = opal_patcher->patch_symbol ("munmap", (uintptr_t)intercept_munmap, (uintptr_t *) &original_munmap);
     if (OPAL_SUCCESS != rc) {
         return rc;
     }
+#endif

 #if defined (SYS_mremap)
     rc = opal_patcher->patch_symbol ("mremap",(uintptr_t)intercept_mremap, (uintptr_t *) &original_mremap);