Bug report #22065
QGis crashes due to conflicting versions of HDF5 libraries when importing h5py module from python plugin
|Affected QGIS version:||3.7(master)||Regression?:||No|
|Operating System:||Windows, MAC Os||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||29878|
This bug was initially reported on https://github.com/PANOimagen/profiletool/issues/23
A workaround has been implemented on ProfileTool to avoid the crash by deactivating the offending h5py import, but the underlying conflicting libraries still exist, this bug should affect any python plugin using h5py.
This does not seem to affect to QGis standalone/Os4Geo Express Desktop installs, but rather os4geo installations with custom installation options. It has been reported on Windows installations using os4geo installer with custom installation options and Mac (QGis 3.4.7 and 3.6.2 from Homebrew/Lutraconsulting).
Some of the libraries/applications bundled by Os4Geo installer seem to be compiled/running against different versions of hdf5 library, which causes QGis to crash when module h5py is imported from a Python plugin via a ```import h5py``` statement. However, running ```import h5py``` from Python console throws an 'ImportError', but does not cause the application to crash.
To reproduce the issue on a Windows machine:
- Download os4geo installer.
- Select all packages for installation.
- Once installed, launch QGis and select ProfileTool (version <= 4.1.6) for installing (the crash can also be triggered installing ProfileTool version <= 4.1.6 manually on python/plugins folder.)
We could pin this down to h5py was thanks to a stack trace on a similar matlab/h5py issue (https://github.com/NeurodataWithoutBorders/api-python/issues/28) where the PyInit__conv call is bound to h5py_conv.cp36-win_amd64.pyd