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_closecan finish without problems. The segfalut happens inside
- 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
new_dxplidfor the H5VLdatset_write, then the test program can finish without problems. The difference is that
dxpl_idis the argument passed to
H5VL_pass_through_ext_file_close, and is a default dataset transfer property list. Using
H5P_DATASET_XFER_DEFAULTcan also finish without problems.
- It seems that
H5Fclosetry to check an already-deleted dxplid (
new_dxplid) and this causes a segmentation fault.
- Because of the above point, I also tried not calling
new_dxplidand in this case, the test program can finish without problem.