hdf5 icon indicating copy to clipboard operation
hdf5 copied to clipboard

Failed to open file in RDWR mode but not in read-only mode

Open bmribler opened this issue 1 year ago • 0 comments

(excerpt from HELP-2625) ...I found a way to reproduce the error: It happens when trying to open a file in RDWR mode which has this superblock status flag set.

With this mode (SWMR is not enabled):

hid_t file_id = H5Fopen(filename, H5F_ACC_RDWR /|H5F_ACC_SWMR_WRITE/, H5P_DEFAULT);

the following assertion occurs:

Assertion failed: H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc, file H5MF.c, line 1818 Assertion failed: H5F_sfile_head_s == NULL, file H5Fsfile.c, line 59

Whereas, when opening the file read-only as

hid_t file_id = H5Fopen(filename, H5F_ACC_RDONLY /|H5F_ACC_SWMR_WRITE/, H5P_DEFAULT);

then it (kind of) correctly reports an sensible error message indicating the problem:

HDF5-DIAG: Error detected in HDF5 (1.14.4-3) thread 28276: #000: H5F.c line 836 in H5Fopen(): unable to synchronously open file major: File accessibility minor: Unable to open file #001: H5F.c line 796 in H5F__open_api_common(): unable to open file major: File accessibility minor: Unable to open file #002: H5VLcallback.c line 3863 in H5VL_file_open(): open failed major: Virtual Object Layer minor: Can't open object #003: H5VLcallback.c line 3675 in H5VL__file_open(): open failed major: Virtual Object Layer minor: Can't open object #004: H5VLnative_file.c line 128 in H5VL__native_file_open(): unable to open file major: File accessibility minor: Unable to open file #005: H5Fint.c line 2195 in H5F_open(): file is already open for write (may use to clear file consistency flags) major: File accessibility minor: Unable to open file

This is with HDF5 1.14.4, like previously mentioned.

bmribler avatar Nov 20 '24 22:11 bmribler