On Linux, using C++ api ,getArrayType on attribute throwing std::bad_alloc execption


#1

Hello,
On Linux, using C++ api ,getArrayType on attribute throwing std::bad_alloc execption. Which is working on Windows. HDF5 version is 1.8.16

Sample code is

                    H5::H5File _file.openFile(file_name, H5F_ACC_RDONLY);
                 H5::Group group = _file.openGroup(group_path);
                 H5::Attribute attr = group.openAttribute(index);
                 H5::DataType temp_dt = attr_ptr.getDataType();

                switch (temp_dt.getClass())
                {
                 case H5T_ARRAY:
                 {
                        H5::ArrayType arr = attr.getArrayType();
                 }
                 }

#2

replacing
H5::ArrayType arr = attr.getArrayType();
with following worked
H5::ArrayType arr(temp_dt.getId())


#3

Hi!
I just want to let you know that I’m investigating this issue.
Thanks,
Binh-Minh
(The HDF Group)


#4

In H5::DataType temp_dt = attr_ptr.getDataType();
Should attr_ptr be attr?