CarpetIOHDF5 corrupts memory when readingi compressed grid structure strings

Issue #1423 closed
Roland Haas created an issue

Input.cc uses H5Dget_storage_size to determine how much memory to allocate for the large string attributes (Paramters and grid structure). However this function literally returns the space used on disk which differs from the space in memory when compression is used (or when the dataset is sparse, or when the datatype on disk is different from that in memory eg float vs double).

The attached patch instead queries the dataspace for the number of points.

Ok to apply? Is there a preferred way of getting this size othewise?

Keyword:

Comments (4)

  1. Roland Haas reporter
    • changed status to open
    • removed comment

    Also change type of data read in to what the memory dataspace is not what the dataspace on disk is. This way HDF5 actually converts from the on-disk representation to the in-memory one.

  2. Log in to comment