Skip to content

Commit 92b82f6

Browse files
authored
Merge pull request #12297 from iyastreb/oshmem/mca/ucx/fix-double-cleanup
ompi/oshmem/spml/ucx: Fix cleanup when disconnected: avoid double free
2 parents bcac86f + 3071892 commit 92b82f6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

oshmem/mca/spml/ucx/spml_ucx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ BEGIN_C_DECLS
4343

4444
#define SPML_UCX_ASSERT MCA_COMMON_UCX_ASSERT
4545
#define SPML_UCX_ERROR MCA_COMMON_UCX_ERROR
46+
#define SPML_UCX_WARN MCA_COMMON_UCX_WARN
4647
#define SPML_UCX_VERBOSE MCA_COMMON_UCX_VERBOSE
4748
#define SPML_UCX_TRANSP_IDX 0
4849
#define SPML_UCX_TRANSP_CNT 1

oshmem/mca/spml/ucx/spml_ucx_component.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ static void mca_spml_ucx_ctx_fini(mca_spml_ucx_ctx_t *ctx)
458458

459459
static int mca_spml_ucx_component_fini(void)
460460
{
461-
int fenced = 0, i;
461+
volatile int fenced = 0;
462+
int i;
462463
int ret = OSHMEM_SUCCESS;
463464
mca_spml_ucx_ctx_t *ctx;
464465

@@ -491,8 +492,10 @@ static int mca_spml_ucx_component_fini(void)
491492

492493

493494
ret = opal_common_ucx_mca_pmix_fence_nb(&fenced);
494-
if (OPAL_SUCCESS != ret) {
495-
return ret;
495+
if (ret != PMIX_SUCCESS) {
496+
SPML_UCX_WARN("pmix fence failed: %s", PMIx_Error_string(ret));
497+
/* In case of pmix fence failure just continue cleanup */
498+
fenced = 1;
496499
}
497500

498501
while (!fenced) {

0 commit comments

Comments
 (0)