Skip to content

ReflectionTable fails to save as H5 when a boolean column exists #27

@yash4karan

Description

@yash4karan

I am having issues writing ReflectionTables as H5 files, but only when a boolean column exists in the ReflectionTable. For any other supported column data type, this error does not show up.

Here is a minimal code snippet that recreates this issue:

#include <dx2/reflection.hpp>
#include <vector>

int main() {
    ReflectionTable refl;
    refl.add_column("id", std::vector{0, 1, 2});
    std::vector<bool> bool_vec(3, true);
    refl.add_column("bool_column", bool_vec);
    refl.write("bool_write.refl");
    return 0;
}

The following is the code added to the corresponding CMakeFile:

add_executable(refl_bool_saving_issue
    refl_bool_saving_issue.cc
)
target_link_libraries(refl_bool_saving_issue
    PRIVATE
    dx2
)

Upon building the executable and running the code, I get the following error:

HDF5-DIAG: Error detected in HDF5 (1.14.6):
  #000: /tmp/hdf5-20250207-38588-gjrv3m/hdf5-1.14.6/src/H5T.c line 2063 in H5Tclose(): not a datatype
    major: Invalid arguments to routine
    minor: Inappropriate type

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions