Skip to content

Commit e7b867c

Browse files
committed
mtl-portals4: don't finalize flow control 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 flow control fini() call if Portals4 was not initialized. Signed-off-by: Todd Kordenbrock <[email protected]>
1 parent ea7e1ea commit e7b867c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ompi/mca/mtl/portals4/mtl_portals4.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2010-2015 Sandia National Laboratories. All rights reserved.
12+
* Copyright (c) 2010-2019 Sandia National Laboratories. All rights reserved.
1313
* Copyright (c) 2014 Intel, Inc. All rights reserved.
1414
* $COPYRIGHT$
1515
*
@@ -551,12 +551,12 @@ ompi_mtl_portals4_finalize(struct mca_mtl_base_module_t *mtl)
551551
if (0 == ompi_mtl_portals4.need_init) {
552552
opal_progress_unregister(ompi_mtl_portals4_progress);
553553
while (0 != ompi_mtl_portals4_progress()) { }
554-
}
555554

556555
#if OMPI_MTL_PORTALS4_FLOW_CONTROL
557-
ompi_mtl_portals4_flowctl_fini();
556+
ompi_mtl_portals4_flowctl_fini();
558557
#endif
559-
ompi_mtl_portals4_recv_short_fini();
558+
ompi_mtl_portals4_recv_short_fini();
559+
}
560560

561561
if (!PtlHandleIsEqual(ompi_mtl_portals4.long_overflow_me_h, PTL_INVALID_HANDLE)) {
562562
PtlMEUnlink(ompi_mtl_portals4.long_overflow_me_h);

0 commit comments

Comments
 (0)