Read hyperslab does not give expected results
- Dominant language
- C
- Stars
- 988
- Forks
- 355
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 12
Description
I created some test data (just a range of numbers starting from 0 to the size of the dataset) and wrote them to file as three-dimensional array with shape [25, 25, 4] and chunk shape [7, 20, 3] (I am working with C# and the P/Invoke package).
Then I read these data back into memory using the following two hyperslab selections:
```cs
// source selection
var datasetStarts = new ulong[] { 2, 2, 0 };
var datasetStrides = new ulong[] { 5, 8, 2 };
var datasetCounts = new ulong[] { 5, 3, 2 };
var datasetBlocks = new ulong[] { 3, 5, 2 };
// target selection
var memoryStarts = new ulong[] { 2, 1 };
var memoryStrides = new ulong[] { 35, 17 };
var memoryCounts = new ulong[] { 2, 1 };
var memoryBlocks = new ulong[] { 30, 15 };
```
I have visualized the process in Matlab using C-style order. Here is the source array combined with the dataset selection, i.e. "0" values are not selected:

And here is my memory selection with the **expected** result:

And last but not least my **actual** result (red color indicates unexpected data values):

The errors appear only when the dataset is chunked. I have created a minimal repo (in C#) and have the project and the resuling .h5 file attached. I do not suspect the P/Invoke package since it really just P/Invokes into the HDF5 library.
Could you please have a look into this?
[hyperslab.zip](https://github.com/HDFGroup/hdf5/files/6149485/hyperslab.zip)
Edit: forgot to mention that I am using HDF5 version 1.10.6.
Contributor guide
Assessment
This issue has not been assessed yet.