BlueBrain / HighFive

HighFive - Header-only C++ HDF5 interface

Home Page:https://bluebrain.github.io/HighFive/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Review NodeTraits::_open.

1uc opened this issue · comments

The following lines are used to open objects:

template <typename Derivate>
inline Object NodeTraits<Derivate>::_open(const std::string& node_name,
const DataSetAccessProps& accessProps) const {
const auto id = H5Oopen(static_cast<const Derivate*>(this)->getId(),
node_name.c_str(),
accessProps.getId());
if (id < 0) {
HDF5ErrMapper::ToException<GroupException>(std::string("Unable to open \"") + node_name +
"\":");
}
return detail::make_object(id);
}

The issue is that the function signature is:

hid_t H5Oopen(hid_t loc_id, const char * name, hid_t lapl_id);  

Parameters
...
[in] lapl_id Link access property list identifier
https://docs.hdfgroup.org/hdf5/v1_12/group___h5_o.html#ga9f635f58c7ddf17f87c253bfbca08bc1

However, we're passing in a DataSetAccessProps object. A quick search only reveal one use

return _open(node_name).getType();

which effectively uses H5P_DEFAULT. Hence, it's plausible that the function is buggy but we've never exercised it in a buggy manner.

A Link Access Property List can be a Group, DataSet or DataType Access Property List.