H5Iregister_type fails with infinite loop, v1.10.4

According to H5Iregister call to work, one needs to register a custom type with H5Iegister_type however when testing it, the library shuts down with with error message posted at the bottom. What am I doing wrong?

#include <iostream>
#include <hdf5.h>
herr_t my_free_func(void* ptr ){
	return 0;
}
int main(int argc, char **argv) {
	H5Iregister_type( 1, 1, my_free_func );
return 0;
}

result:

HDF5: infinite loop closing library
      L,T_top,P,P,FD,E,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I

Steven,

The code looks valid. I entered a problem report https://jira.hdfgroup.org/browse/HDFFV-10714

Thank you!

Elena

1 Like

As a workaround one can use H5Idestroy_type call.

#include <hdf5.h>
herr_t my_free_func(void* ptr ){
	return 0;
}
int main(int argc, char **argv) {
        H5I_type_t my_type;
	my_type = H5Iregister_type( 1, 1, my_free_func );
        H5Idestroy_type(my_type);

return 0;
}