Merge pull request #6855 from hkuno/hkuno/mmap_loop
Fix mmap infinite recurse in memory patcher
Этот коммит содержится в:
Коммит
71e1fad4a9
@ -47,13 +47,15 @@ AC_DEFUN([MCA_opal_memory_patcher_CONFIG],[
|
|||||||
esac
|
esac
|
||||||
AC_MSG_RESULT([$opal_memory_patcher_happy])
|
AC_MSG_RESULT([$opal_memory_patcher_happy])
|
||||||
|
|
||||||
|
# syscall interface causes compiler warnings.
|
||||||
|
# Per the above logic, memory patcher no longer supports MacOS/Darwin,
|
||||||
|
# so we no longer support Darwin-specific logic for intercept_mmap.
|
||||||
|
# See issue #6853: mmap infinite recurse in opal/mca/memory/patcher
|
||||||
AS_IF([test "$opal_memory_patcher_happy" == "yes"], [
|
AS_IF([test "$opal_memory_patcher_happy" == "yes"], [
|
||||||
AC_CHECK_FUNCS([__curbrk])
|
AC_CHECK_FUNCS([__curbrk])
|
||||||
AC_CHECK_HEADERS([linux/mman.h sys/syscall.h])
|
AC_CHECK_HEADERS([linux/mman.h sys/syscall.h])
|
||||||
AC_CHECK_DECLS([__mmap], [], [], [#include <sys/mman.h>])
|
AC_CHECK_DECLS([__syscall], [], [], [#include <sys/syscall.h>])
|
||||||
AC_CHECK_FUNCS([__mmap])
|
AC_CHECK_FUNCS([__syscall])
|
||||||
AC_CHECK_DECLS([__syscall], [], [], [#include <sys/syscall.h>])
|
|
||||||
AC_CHECK_FUNCS([__syscall])
|
|
||||||
$1], [$2])
|
$1], [$2])
|
||||||
|
|
||||||
AC_CONFIG_FILES([opal/mca/memory/patcher/Makefile])
|
AC_CONFIG_FILES([opal/mca/memory/patcher/Makefile])
|
||||||
|
@ -125,12 +125,7 @@ static void *_intercept_mmap(void *start, size_t length, int prot, int flags, in
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!original_mmap) {
|
if (!original_mmap) {
|
||||||
#ifdef HAVE___MMAP
|
|
||||||
/* the darwin syscall returns an int not a long so call the underlying __mmap function */
|
|
||||||
result = __mmap (start, length, prot, flags, fd, offset);
|
|
||||||
#else
|
|
||||||
result = (void*)(intptr_t) memory_patcher_syscall(SYS_mmap, start, length, prot, flags, fd, offset);
|
result = (void*)(intptr_t) memory_patcher_syscall(SYS_mmap, start, length, prot, flags, fd, offset);
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
result = original_mmap (start, length, prot, flags, fd, offset);
|
result = original_mmap (start, length, prot, flags, fd, offset);
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user