H5EA header deserialize computes index block statistics from nsblks before H5EA__hdr_init sets it
Maintainers usually reply within 1 day
@vchoi-hdfgroup is already working on this.
Since Nov 10, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in src/H5EAcache.c at H5EA__cache_hdr_deserialize and read how the index block statistics are calculated relative to the later H5EA__hdr_init call. The issue suggests moving the calculation below initialization or deriving nsblks from cparam; verify that the computed size matches the file’s index block and that h5stat reports the expected chunk-index storage.
Written by the indexing model from the issue text.
Description
Where (develop, c9fcf527, 2026-11-06)
H5EA__cache_hdr_deserialize fills the index block statistics before the header is initialised:
src/H5EAcache.c:351-357: a fake index block is set up with
iblock.nsblk_addrs = hdr->nsblks - iblock.nsblks;and
hdr->stats.computed.index_blk_size = H5EA_IBLOCK_SIZE(&iblock);hdr->nsblksis only set inH5EA__hdr_init(src/H5EAhdr.c:185), which the same function calls later, at
src/H5EAcache.c:376.- The header comes from
H5FL_CALLOC(H5EA__hdr_alloc,src/H5EAhdr.c), sohdr->nsblksis 0 when it is
read, andnsblk_addrsis computed from 0 instead of the real number of super blocks.
Effect
stats.computed.index_blk_size does not match the index block in the file, so the chunk-index storage that
h5stat reports for datasets with an extensible-array index is wrong.
Example with a file from the HDF5 test suite, tools/test/testfiles/h5fc_ext1_f.h5, dataset
/DSET_EA (extensible array header at address 1283, index block at 1355). From the header (h5debug): 4 elements
in the index block, raw element size 8, at least 4 data block pointers per super block, at least 16 elements per
data block. With H5EA_IBLOCK_SIZE and nsblks = 1 + (max_nelmts_bits - log2(16)) the index block is 298 bytes
(prefix 6 + header address 8 + checksum 4 + 4 elements × 8 + 6 data block addresses × 8 + 25 super block
addresses × 8). The statistics are computed with nsblks = 0 instead.
Suggested fix
Compute the index block statistics after H5EA__hdr_init (move the block at H5EAcache.c:342-361 below the
call at :376), or compute nsblks from cparam before using it.
Found while checking the bytes our pure-Go HDF5 implementation (https://github.com/scigolib/hdf5) frees when it
deletes a dataset against h5stat.
- Dominant language
- C
- Stars
- 1k
- Forks
- 372
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 57
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HDFGroup/hdf5
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
hdf5_hl_fortran.pc doesn't require hdf5_hl, so static high-level Fortran links failPossibly taken @jhendersonHDF claimed this 13 days ago. OpenComponent - Build
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
HDFGroup/hdf5#6819 · 1 assignee ·
Maintainers usually reply within 1 day
-
Bug reports by unicorn0016 are now visible after being incorrectly flagged as spamMay be free again @glennsong09 claimed this 31 days ago, and no pull request is open. Open
Difficulty 1/5 Under an hour Newbie friendliness 70/100
HDFGroup/hdf5#6719 · 1 assignee ·
Maintainers usually reply within 1 day
-
`check_required_components()` in HDF5's CMake package configuration file doesn't functionMay be free again @mattjala claimed this 48 days ago, and no pull request is open. OpenComponent - Build
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
HDFGroup/hdf5#6690 · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
awslabs/aws-c-auth#315 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#2365 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
ChupathingyCE/chupathingyce#1128 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
php/pecl-networking-ssh2#111 ·