Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H5O_info[1]_t type definition is incorrect #980

Closed
mkitti opened this issue Jun 27, 2022 · 0 comments · Fixed by #1007
Closed

H5O_info[1]_t type definition is incorrect #980

mkitti opened this issue Jun 27, 2022 · 0 comments · Fixed by #1007

Comments

@mkitti
Copy link
Member

mkitti commented Jun 27, 2022

In working through #979 I discovered that our H5O_info[1]_t definition is incorrect.

https://cs.github.com/HDFGroup/hdf5/blob/c064d3481b582653c1e0d0043a17527fd73e8c4d/src/H5Opublic.h#L1690

typedef struct H5O_info1_t {
    unsigned long  fileno;    /**< File number that object is located in */
    haddr_t        addr;      /**< Object address in file                */
    H5O_type_t     type;      /**< Basic object type (group, dataset, etc.) */
    unsigned       rc;        /**< Reference count of object    */
    time_t         atime;     /**< Access time                  */
    time_t         mtime;     /**< Modification time            */
    time_t         ctime;     /**< Change time                  */
    time_t         btime;     /**< Birth time                   */
    hsize_t        num_attrs; /**< Number of attributes attached to object */
    H5O_hdr_info_t hdr;       /**< Object header information */
    /* Extra metadata storage for obj & attributes */
    struct {
        H5_ih_info_t obj;  /**< v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
        H5_ih_info_t attr; /**< v2 B-tree & heap for attributes */
    } meta_size;
} H5O_info1_t;
  • fileno should be Culong
  • otype should be type

https://github.com/JuliaIO/HDF5.jl/blob/master/src/api/types.jl#L66-L92

The current version works due to padding. fieldoffset(H5O_info_t, 2) yields 8 regardless of the type of fileno.

julia> fieldoffset(HDF5.API.H5O_info_t, 2)
0x0000000000000008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant