Skip to content

Commit

Permalink
Fix for github issue HDFGroup#2414: segfault when copying dataset wit…
Browse files Browse the repository at this point in the history
…h attributes.

This also fixes github issue HDFGroup#3241: segfault when copying dataset.
Need to set the location via H5T_set_loc() of the src datatype
when copying dense attributes.
Otherwise the vlen callbacks are not set up therefore causing seg fault
when doing H5T_convert() -> H5T__conv_vlen().
  • Loading branch information
vchoi-hdfgroup committed Jan 29, 2024
1 parent 1bea9e6 commit 3169e59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/H5Aint.c
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,10 @@ H5A__dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata)
assert(udata->file);
assert(udata->cpy_info);

/* Set the location of the src datatype */
if (H5T_set_loc(attr_src->shared->dt, H5F_VOL_OBJ(udata->oloc_src->file), H5T_LOC_DISK) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk");

if (NULL ==
(attr_dst = H5A__attr_copy_file(attr_src, udata->file, udata->recompute_size, udata->cpy_info)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute");
Expand Down

0 comments on commit 3169e59

Please sign in to comment.