diff options
author | vchoi <vchoi@jelly.ad.hdfgroup.org> | 2021-12-14 19:04:27 (GMT) |
---|---|---|
committer | vchoi <vchoi@jelly.ad.hdfgroup.org> | 2021-12-14 19:04:27 (GMT) |
commit | 51a3a47bc3807ebf51817ac7f4d16910bb69134d (patch) | |
tree | dbd1d5bfc413ad6b49d9ca2179d369a64e6e9df0 /src/H5Fvfd_swmr.c | |
parent | 4744cbdfac76475be72cf97e085076484bf1ab14 (diff) | |
download | hdf5-51a3a47bc3807ebf51817ac7f4d16910bb69134d.zip hdf5-51a3a47bc3807ebf51817ac7f4d16910bb69134d.tar.gz hdf5-51a3a47bc3807ebf51817ac7f4d16910bb69134d.tar.bz2 |
Fix the failure triggered by running the bigset test with 2D dataset that expands
for more than 200 times. It is due to the indexing error for the metadata file index
and the change list array.
Diffstat (limited to 'src/H5Fvfd_swmr.c')
-rw-r--r-- | src/H5Fvfd_swmr.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c index 2ac5e6c..43567ac 100644 --- a/src/H5Fvfd_swmr.c +++ b/src/H5Fvfd_swmr.c @@ -2251,7 +2251,7 @@ H5F__generate_updater_file(H5F_t *f, uint32_t num_entries, uint16_t flags, uint8 H5FD_t * ud_file = NULL; /* Low-level file struct */ char namebuf[H5F__MAX_VFD_SWMR_FILE_NAME_LEN]; char newname[H5F__MAX_VFD_SWMR_FILE_NAME_LEN]; - unsigned i; + unsigned i, j; hsize_t alloc_size; herr_t ret_value = SUCCEED; /* Return value */ @@ -2337,21 +2337,23 @@ H5F__generate_updater_file(H5F_t *f, uint32_t num_entries, uint16_t flags, uint8 HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for ud cl") /* Initialize change list entries */ - for (i = 0; i < num_entries; i++) { + i = 0; + for (j = 0; j < num_entries; j++) { - if (shared->mdf_idx[i].entry_ptr != NULL && - shared->mdf_idx[i].tick_of_last_change == shared->tick_num) { + if (shared->mdf_idx[j].entry_ptr != NULL && + shared->mdf_idx[j].tick_of_last_change == shared->tick_num) { - updater.change_list[i].entry_image_ptr = shared->mdf_idx[i].entry_ptr; + updater.change_list[i].entry_image_ptr = shared->mdf_idx[j].entry_ptr; updater.change_list[i].entry_image_ud_file_page_offset = 0; updater.change_list[i].entry_image_md_file_page_offset = - (uint32_t)shared->mdf_idx[i].md_file_page_offset; + (uint32_t)shared->mdf_idx[j].md_file_page_offset; updater.change_list[i].entry_image_h5_file_page_offset = - (uint32_t)shared->mdf_idx[i].hdf5_page_offset; - updater.change_list[i].entry_image_len = shared->mdf_idx[i].length; - updater.change_list[i].entry_image_checksum = shared->mdf_idx[i].checksum; + (uint32_t)shared->mdf_idx[j].hdf5_page_offset; + updater.change_list[i].entry_image_len = shared->mdf_idx[j].length; + updater.change_list[i].entry_image_checksum = shared->mdf_idx[j].checksum; - shared->mdf_idx[i].entry_ptr = NULL; + shared->mdf_idx[j].entry_ptr = NULL; + i++; } } |