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

Commit 29b837a

Browse files
authored
Merge pull request #1226 from hjelmn/v2.x_mem_hook_fix
opal/memory: disable __malloc_initialize_hook if poisoned
2 parents 1073733 + 0579535 commit 29b837a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ OPAL_SEARCH_LIBS_CORE([ceil], [m])
838838
# -lrt might be needed for clock_gettime
839839
OPAL_SEARCH_LIBS_CORE([clock_gettime], [rt])
840840

841-
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair strncpy_s usleep mkfifo dbopen dbm_open statfs statvfs setpgid setenv])
841+
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair strncpy_s usleep mkfifo dbopen dbm_open statfs statvfs setpgid setenv __malloc_initialize_hook])
842842

843843
# Sanity check: ensure that we got at least one of statfs or statvfs.
844844
if test $ac_cv_func_statfs = no && test $ac_cv_func_statvfs = no; then

ompi/runtime/ompi_mpi_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,16 @@
9393
#include "ompi/dpm/dpm.h"
9494
#include "ompi/mpiext/mpiext.h"
9595

96+
/* newer versions of gcc have poisoned this deprecated feature */
97+
#if HAVE___MALLOC_INITIALIZE_HOOK
9698
#include "opal/mca/memory/base/base.h"
9799
/* So this sucks, but with OPAL in its own library that is brought in
98100
implicity from libmpi, there are times when the malloc initialize
99101
hook in the memory component doesn't work. So we have to do it
100102
from here, since any MPI code is going to call MPI_Init... */
101103
OPAL_DECLSPEC void (*__malloc_initialize_hook) (void) =
102104
opal_memory_base_malloc_init_hook;
105+
#endif
103106

104107
/* This is required for the boundaries of the hash tables used to store
105108
* the F90 types returned by the MPI_Type_create_f90_XXX functions.

0 commit comments

Comments
 (0)