Skip to content

Commit

Permalink
Dont be eager to free the datatype.
Browse files Browse the repository at this point in the history
A datatype has multiple associations with an arena, and the arenas are
correctly refcounted. If we release the datatype once we release one refcount
on the arenas bad things will happen. Instead only free the datatype once we
released all associated arenas.

Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
  • Loading branch information
bosilca committed Aug 1, 2023
1 parent 47eec14 commit 55eb92b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/include/dplasma/types_lapack.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,13 @@ void dplasma_clean_adtt_all_loc(const dplasma_data_collection_t * ddc, int max_s
if ( dplasma_cleanup_datatype_info(ddc, &info, &adt) == 0) {
/* Retained when reusing it, not set on JDF array, not release by taskpool destructor */
PARSEC_OBJ_RELEASE(adt.arena);
dplasma_matrix_del2arena(&adt);
/* A datatype being registered with multiple info we should
* only release the datatype once all info have been
* removed. We can track this using the refcount on the
* arena itself.
*/
if( NULL == adt.arena )
dplasma_matrix_del2arena(&adt);
}
}
}
Expand Down

0 comments on commit 55eb92b

Please sign in to comment.