Skip to content

Commit c7a2619

Browse files
committed
ofi: Fix memory handler unregistration
Resetting the installed_memory_monitor flag should be in the error handling case, rather than blindly set, so that the memory hook handler can be properly deregistered during shutdown. This change fixes a segfault during shutdown if the common/ofi component was built as a dynamic object. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent 0fca458 commit c7a2619

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opal/mca/common/ofi/common_ofi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ int opal_common_ofi_export_memory_monitor(void)
187187
if (NULL != opal_common_ofi_monitor) {
188188
free(opal_common_ofi_monitor);
189189
}
190-
}
191190

192-
opal_common_ofi_installed_memory_monitor = false;
191+
opal_common_ofi_installed_memory_monitor = false;
192+
}
193193

194194
OPAL_THREAD_UNLOCK(&opal_common_ofi_mutex);
195195
#endif

0 commit comments

Comments
 (0)