Bug report #22065

QGis crashes due to conflicting versions of HDF5 libraries when importing h5py module from python plugin

Added by Javier Becerra Elcinto over 5 years ago. Updated over 5 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Build/Install
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

Description

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.)

A stack trace quite similar to this one appears also on issues #21811, #19803 and #21170

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

profiletool_crash.txt Magnifier - Stacktrace obtained after installing ProfileTool version 4.1.6 on a QGis installation with conflicting hdf5 dlls. (8.26 KB) Javier Becerra Elcinto, 2019-05-13 05:18 PM

profiletool_crash_dev_version.txt Magnifier - Stacktrace obtained with QGis dev version. (9.52 KB) Javier Becerra Elcinto, 2019-05-13 05:54 PM

History

#1 Updated by Jürgen Fischer over 5 years ago

  • Description updated (diff)

Also available in: Atom PDF