Skip to content

Commit 7523357

Browse files
committed
pmix: Increment the reference count in PMIx_Init
The reference counting was broken which led PMIx_Finalize to release resources early. This fixes the "use after free" scenarios that I encountered. (based on commit openpmix/openpmix@abfaa4c)
1 parent e7433fc commit 7523357

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

opal/mca/pmix/pmix112/pmix/src/client/pmix_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ int PMIx_Init(pmix_proc_t *proc)
248248
(void)strncpy(proc->nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN);
249249
proc->rank = pmix_globals.myid.rank;
250250
}
251+
++pmix_globals.init_cntr;
251252
return PMIX_SUCCESS;
252253
}
253254

opal/mca/pmix/pmix120/pmix/src/client/pmix_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ int PMIx_Init(pmix_proc_t *proc)
258258
(void)strncpy(proc->nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN);
259259
proc->rank = pmix_globals.myid.rank;
260260
}
261+
++pmix_globals.init_cntr;
261262
return PMIX_SUCCESS;
262263
}
263264
/* if we don't see the required info, then we cannot init */

0 commit comments

Comments
 (0)