HDFGroup / hdf5

Official HDF5® Library Repository
https://www.hdfgroup.org/
Other
588 stars 243 forks source link

Assertion failure from H5VL_NATIVE macro #4723

Open jhendersonHDF opened 3 weeks ago

jhendersonHDF commented 3 weeks ago

Describe the bug

The following simple code causes an assertion failure in debug builds of HDF5 due to entering the library in a way that doesn't initialize it. As the initialization function that this macro maps to is a public function, it should likely be converted from a FUNC_ENTER_NOAPI function to a FUNC_ENTER_API function.

#include "hdf5.h"

int
main(int argc, char **argv)
{
    H5VL_NATIVE;
    return 0;
}

Expected behavior

No assertion failure should be encountered.

Platform

qkoziol commented 3 weeks ago

Unfortunately, I can't switch H5VL_native_register() from FUNC_ENTER_NOAPI to FUNC_ENTER_API without changing its name (to H5VLnative_register), which I'm pretty reluctant to do.

I'll look into some other ways to solve this.

jhendersonHDF commented 3 weeks ago

Unfortunately, I can't switch H5VL_native_register() from FUNC_ENTER_NOAPI to FUNC_ENTER_API without changing its name (to H5VLnative_register), which I'm pretty reluctant to do.

I'll look into some other ways to solve this.

Is this only because of the namecheck functionality? If so, I'd be more than in favor of removing that from the API versions of the FUNC_ENTER macros since I'd assume the naming of public API calls should hopefully be obvious to developers.