Skip to content

Commit de48282

Browse files
committed
mtl-portals4: don't call progress() in finalize() if Portals4 was not initialized
This commit fixes a segfault in mtl-portals4 finalize(). The segfault occurs if finalize() is called without any calls to add_procs(). This commit resolves the segfault by skipping the progress() loop in finalize() if the Portals was not initialized. Signed-off-by: Todd Kordenbrock ([email protected]) (cherry picked from commit 9065967)
1 parent 1d19dd3 commit de48282

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ompi/mca/mtl/portals4/mtl_portals4.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,10 @@ ompi_mtl_portals4_del_procs(struct mca_mtl_base_module_t *mtl,
548548
int
549549
ompi_mtl_portals4_finalize(struct mca_mtl_base_module_t *mtl)
550550
{
551-
opal_progress_unregister(ompi_mtl_portals4_progress);
552-
while (0 != ompi_mtl_portals4_progress()) { }
551+
if (0 == ompi_mtl_portals4.need_init) {
552+
opal_progress_unregister(ompi_mtl_portals4_progress);
553+
while (0 != ompi_mtl_portals4_progress()) { }
554+
}
553555

554556
#if OMPI_MTL_PORTALS4_FLOW_CONTROL
555557
ompi_mtl_portals4_flowctl_fini();

0 commit comments

Comments
 (0)