HDFGroup / HDF.PInvoke

Raw HDF5 Power for .NET
http://www.hdfgroup.org/HDF5
Other
80 stars 29 forks source link

HDF5-DIAG: Error detected in HDF5 (1.10.2) thread 11136: H5G.c line 615 in H5Gget_info_by_name(): group not found #147

Closed bendiy closed 5 years ago

bendiy commented 6 years ago

When running this code:

...
H5G.info_t info = new H5G.info_t();
// Next line triggers console error:
var gid = H5G.get_info_by_name(myFileId, "my_group_name_here", ref info);
// Code from here on does continue to run and works fine...
...

I get this error in the console:

HDF5-DIAG: Error detected in HDF5 (1.10.2) thread 11136:
  #000: D:\build\HDF5\1.10.2\hdf5-1.10.2\src\H5G.c line 615 in H5Gget_info_by_name(): group not found
    major: Symbol table
    minor: Object not found
  #001: D:\build\HDF5\1.10.2\hdf5-1.10.2\src\H5Gloc.c line 428 in H5G_loc_find(): can't find object
    major: Symbol table
    minor: Object not found
  #002: D:\build\HDF5\1.10.2\hdf5-1.10.2\src\H5Gtraverse.c line 867 in H5G_traverse(): internal path traversal failed
    major: Symbol table
    minor: Object not found
  #003: D:\build\HDF5\1.10.2\hdf5-1.10.2\src\H5Gtraverse.c line 639 in H5G_traverse_real(): traversal operator failed
    major: Symbol table
    minor: Callback failed
  #004: D:\build\HDF5\1.10.2\hdf5-1.10.2\src\H5Gloc.c line 383 in H5G_loc_find_cb(): object 'my_group_name_here' doesn't exist
    major: Symbol table
    minor: Object not found

The code does continue to run and works fine. Is this error some kind of debug message?

Docs say: https://support.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetInfoByName

Returns a non-negative value if successful; otherwise returns a negative value.

I didn't expect to see the error in the console when checking for a Group that doesn't exist. Only a negative value for gid.

Apollo3zehn commented 6 years ago

You can confirm the existence of the group using H5L.exists() like I did here. I am not sure right now if you need a preceding forward slash. So maybe this will work:

H5G.info_t info = new H5G.info_t();
long gid = -1;

if (H5L.exists(myFileId, "/my_group_name_here") == 0)
{
    gid = H5G.get_info_by_name(myFileId, "/my_group_name_here", ref info);
}
gheber commented 5 years ago

Printing the default error stack (of the native library) is turned on by default. You can turn it off via H5E.set_auto. See https://support.hdfgroup.org/HDF5/doc/RM/RM_H5E.html#Error-SetAuto2

bendiy commented 5 years ago

@gheber Thanks!

Just circling back around to this. I added the following to my code and it appears to silence the redundant errors I was seeing.

H5E.set_auto(H5E.DEFAULT, null, IntPtr.Zero);