Failed to open file in RDWR mode but not in read-only mode #5135
Labels
Component - C Library
Core C library issues (usually in the src directory)
Priority - 1. High 🔼
These are important issues that should be resolved in the next release
Type - Bug / Bugfix
Please report security issues to [email protected] instead of creating an issue on GitHub
(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
#1: H5F.c line 796 in H5F__open_api_common(): unable to open file
major: File accessibility
minor: Unable to open file
#2: H5VLcallback.c line 3863 in H5VL_file_open(): open failed
major: Virtual Object Layer
minor: Can't open object
#3: H5VLcallback.c line 3675 in H5VL__file_open(): open failed
major: Virtual Object Layer
minor: Can't open object
#4: H5VLnative_file.c line 128 in H5VL__native_file_open(): unable to open file
major: File accessibility
minor: Unable to open file
#5: 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.
The text was updated successfully, but these errors were encountered: