Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
qgib opened this issue May 13, 2019 · 6 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Crash/Data Corruption Feedback Waiting on the submitter for answers

Comments

@qgib
Copy link
Contributor

qgib commented May 13, 2019

Author Name: Javier Becerra Elcinto (Javier Becerra Elcinto)
Original Redmine Issue: 22065
Affected QGIS version: 3.7(master)
Redmine category:build/install


This bug was initially reported on PANOimagen/profiletool#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 #29626, #27628 and #28988

We could pin this down to h5py was thanks to a stack trace on a similar matlab/h5py issue (NeurodataWithoutBorders/api-python#28) where the PyInit__conv call is bound to h5py_conv.cp36-win_amd64.pyd


@qgib
Copy link
Contributor Author

qgib commented May 13, 2019

Author Name: Jürgen Fischer (@jef-n)


  • description was changed from This bug was initially reported on Profiletool crashes Qgis on install PANOimagen/profiletool#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:

https://issues.qgis.org/issues/21811
https://issues.qgis.org/issues/19803
https://issues.qgis.org/issues/21170

We could pin this down to h5py was thanks to a stack trace on a similar matlab/h5py issue (NeurodataWithoutBorders/api-python#28) where the PyInit__conv call is bound to h5py_conv.cp36-win_amd64.pyd

to This bug was initially reported on PANOimagen/profiletool#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 #29626, #27628 and #28988

We could pin this down to h5py was thanks to a stack trace on a similar matlab/h5py issue (NeurodataWithoutBorders/api-python#28) where the PyInit__conv call is bound to h5py_conv.cp36-win_amd64.pyd

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Crash/Data Corruption labels May 25, 2019
@PeterPetrik
Copy link
Contributor

maybe same as qgis/QGIS-Mac-Packager#7 (comment)

@delhomer
Copy link

delhomer commented Jul 1, 2019

Same problem here on Ubuntu 18.04 with QGIS 3.4.9.

I tried to import tensorflow on the QGIS console, however the import tensorflow just crashed QGIS, with a cryptic stacktrace. As it mentions h5py too (h5py is a Tensorflow dependency), I tried import h5py in the QGIS console and it failed in the same manner.

Following another thread, I've tried to reload h5py module; it kind of solves my problem (I can now import h5py and Tensorflow from the QGIS console), even if I'm still unsure of which version is used by QGIS. :)

I saw #27628 first, however I hope it may confirm the diagnosis done in the original message.

@PCdurham
Copy link

In version 3.4 LTR, win10, I am now able to import the non-gpu version of tensorflow after downgrading h5py to v2.9. Versions 2.8 and 2.10 of h5py both bug.

@alexbruy
Copy link
Contributor

Still an issue with 3.10/master?

@alexbruy alexbruy added the Feedback Waiting on the submitter for answers label Apr 19, 2020
@alexbruy
Copy link
Contributor

alexbruy commented Aug 3, 2020

Closing for the lack of feedback. Please reopen if necessary.

@alexbruy alexbruy closed this as completed Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Crash/Data Corruption Feedback Waiting on the submitter for answers
Projects
None yet
Development

No branches or pull requests

5 participants