Skip to content

Commit 5a27aec

Browse files
committed
typerep: Call device commit hook when unflattening type
Unflattened types are considered "committed" and used in communication. When they are eventually freed, the device free hook will be invoked, so we need to make sure that the commit hook is invoked at creation time. Otherwise we may read uninitialized values during free. Issue was found using valgrind and the ch4:ucx device with PETSc CI tests. Reported-by: Satish Balay <[email protected]>
1 parent 550e6ec commit 5a27aec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mpi/datatype/typerep/src/typerep_flatten.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ int MPIR_Typerep_unflatten(MPIR_Datatype * datatype_ptr, void *flattened_type)
132132
MPIR_ERR_CHECK(mpi_errno);
133133
#endif
134134

135+
mpi_errno = MPID_Type_commit_hook(datatype_ptr);
136+
MPIR_ERR_CHECK(mpi_errno);
137+
135138
fn_exit:
136139
return mpi_errno;
137140

0 commit comments

Comments
 (0)