Skip to content

Commit d620ad1

Browse files
markalleawlauria
authored andcommitted
fix a memory hook recursion hang
Without this checkin, it's possible for a stack trace like the following to occur: free() madvise() intercept_madvise() opal_mem_hooks_release_hook(), loop of registered callbacks which includes ompi_mtl_mxm_mem_release_cb() mxm_mem_unmap(,,from_alloc=false) ... free() The problem is since we're already in glibc free() we need to call the release callback with from_alloc=true so it will take a more conservative path and only record the memory being released without making any malloc/free calls. Signed-off-by: Austen Lauria <awlauria@us.ibm.com>
1 parent 252b6bf commit d620ad1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opal/mca/memory/patcher/memory_patcher_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int _intercept_madvise(void *start, size_t length, int advice)
303303
advice == MADV_REMOVE ||
304304
# endif
305305
advice == POSIX_MADV_DONTNEED) {
306-
opal_mem_hooks_release_hook(start, length, false);
306+
opal_mem_hooks_release_hook(start, length, true);
307307
}
308308

309309
if (!original_madvise) {

0 commit comments

Comments
 (0)