Hi there,
Brief summary of the problem
I am trying to develop a new VOL that is basically a Passthru VOL but does the following extra thing at file close time:
- create a new HDF5 dataset called
TEST_DSET
(assuming no other dataset has the same name) - write some data to the dataset
- close the dataset and file.
However, during step 2 when writing the dataset, I cannot use a self-created dxplid. Otherwise, a segmentation fault inside H5CX_pop
will occur.
Not exactly sure but fixing this problem may need HDF5 developers’ help, since it seems not a VOL implementation problem.
How to reproduce the problem
This GitHub repo contains codes I wrote for the new VOL. It is the same as the original Passthru VOL except for the H5VL_pass_through_ext_file_close
function. Inside H5VL_pass_through_ext_file_close
, I created a new dataset called TEST_DSET
and write some data to it using a new dxplid called new_dxplid
. A segmentation fault inside HDF5 library (H5SL.c:1320)
A simple user application (test program) together with a makefile is available here.
More details about the problem
- The error does not happen inside
H5VL_pass_through_ext_file_close
.H5VL_pass_through_ext_file_close
can finish without problems. The segfalut happens insideH5CX_pop
ofH5Fclose
. - If I comment out the H5VLdatset_write, i.e. a dataset is created but not written, then the test program can finish without problems.
- If I use
dxpl_id
instead ofnew_dxplid
for the H5VLdatset_write, then the test program can finish without problems. The difference is thatdxpl_id
is the argument passed toH5VL_pass_through_ext_file_close
, and is a default dataset transfer property list. UsingH5P_DATASET_XFER_DEFAULT
can also finish without problems. - It seems that
H5CX_pop
ofH5Fclose
try to check an already-deleted dxplid (new_dxplid
) and this causes a segmentation fault. - Because of the above point, I also tried not calling
H5Pclose
overnew_dxplid
and in this case, the test program can finish without problem.