Closed james-s-willis closed 3 years ago
It seg faults when trying to load the following symbols in hdf5_dl.c
:
/*Variables*/
H5E_CANTREGISTER_g = *((hid_t *)dlsym(handle, "H5E_CANTREGISTER_g"));
H5E_CALLBACK_g = *((hid_t *)dlsym(handle, "H5E_CALLBACK_g"));
H5E_PLINE_g = *((hid_t *)dlsym(handle, "H5E_PLINE_g"));
H5E_ERR_CLS_g = *((hid_t *)dlsym(handle, "H5E_ERR_CLS_g"));
I tried to reproduce locally following similar steps as in CI:
We never got such issue reported to hdf5plugin
and it worked in both cases.
It looks to be related to calling init_filter
from cython code.
I made it work by commenting the calls to init_filter
and register_h5_filter
in h5.pyx
and running:
from bitshuffle import h5
import h5py, ctypes
lib = ctypes.CDLL(h5.__file__)
lib.init_filter.argtypes = [ctypes.c_char_p]
lib.init_filter.restype = ctypes.c_int
lib.init_filter(bytes(h5py.h5z.__file__, encoding='utf-8'))
h5.register_h5_filter()
Thanks for looking into this. I found that H5E_CANTREGISTER_g, H5E_CALLBACK_g, H5E_PLINE_g, H5E_ERR_CLS_g symbols are not included in h5py.h5d
when h5py
is installed with --no-binary=h5py
. If you use h5py.h5z
(like in your fix) to initialise the filter it works fine.
Good! I actually use h5z
in hdf5plugin
, but I didn't expected that would make a difference to use another... maybe it depends on the way h5py links to libhdf5.
@t20100, since your change to dynamically load libhdf5 (#81). We've noticed a seg fault in bitshuffle when importing:
But this only occurs when installing
h5py
with:pip install --no-binary=h5py h5py
. Have you seen this kind of error before?