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

Profiletool crashes Qgis on install #23

Closed
palousegeo opened this issue Mar 14, 2019 · 15 comments
Closed

Profiletool crashes Qgis on install #23

palousegeo opened this issue Mar 14, 2019 · 15 comments
Assignees
Labels

Comments

@palousegeo
Copy link

I tried to install the profile tool plugin and it crashed QGIS. This happened on two different computers both Windows 10 with versions 3.4.5, 3.6.0 and 3.7.0. The tool does show up in the plugins list after the crash. However, it crashes the program again when I try to activate it. I also tried a fresh profile with the profile tool as the only added plugin and it also crashed QGIS.
profiletool_crash.txt

@JaviBecerra
Copy link
Member

JaviBecerra commented Mar 15, 2019

Hi @palousegeo,
We have tested the plugin on windows 8.1 against QGis 3.4.4 and 3.6.0, and on windows 10 against 3.4.3 without an issue. We are checking again on Windows 10 against newer versions just in case something changed in 3.4.5. Windows 10 and QGis 3.6.0 has worked fine too.

Looking at the stack trace we are finding a PyErr_NoMemory, could it be an issue with your system's available RAM? Are you trying to install the plugin while loading some big layers on memory?

Can you see any error messages on the Python message pane? Perhaps that could help us find out a bit more.

@JaviBecerra JaviBecerra self-assigned this Mar 15, 2019
@palousegeo
Copy link
Author

palousegeo commented Mar 15, 2019 via email

@JaviBecerra
Copy link
Member

Hi Rick,
We have checked with another windows 10 machine with 3.4.4 and 3.6.0 and we have not been able to reproduce the issue yet :(
Can you please provide the following info:
-What version of the plugin are you using, the latest one available from the QGis plugin repository or you installed manually the one in github (we have to publish an update with latests commits so they are slightly out of sync). If you have been using the plugin manager to download the plugin, please try installing manually the latest version on github.
-Have you used the QGis standalone installer or the OSGeo installer for the QGis installation?
-Have you had any issue with any other plugin or is this issue exclusive to ProfileTool?
-Can you think of any tool/plugin/loaded layer... shared by the different setups you tested?

The stack trace does not seem to show any call to the plugin's code itself, but I am not too familiar with QGis/Qt plugin loading system. We will send an email to qgis-dev list if we are not able to find out what is causing this and see if someone has a better idea of what is going on according to that stacktrace.

@JaviBecerra
Copy link
Member

JaviBecerra commented Mar 18, 2019

I have found some bug reports with quite similar stacktraces:

https://issues.qgis.org/issues/18220
https://issues.qgis.org/issues/19197
bstroebl/DigitizingTools#30

However all of them seem to be solved by reinstalling QGis, the plugins or both...

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

@JaviBecerra
Copy link
Member

Hi @palousegeo:
Any news on this issue? Have you finally been able to install the plugin?
If you still have trouble, can you please provide us with the information I mentioned in my previous comment (#23 (comment))
Regards,
Javier

@palousegeo
Copy link
Author

Sorry, I haven't had much time available for testing. However, I updated both QGIS (3.6.1) and the profile tool (4.1.6) today. As soon as I activated the tool QGIS crashed. This is the case for a diverse set of 4 Windows 10 computers I usually work on. On each of these computers I installed and updated QGIS through the OSGEO4Wx64 packages. I am not having issues with other plugins. As mentioned above, I tried this on a clean profile (no plugins other than the base set, with all these turned off) with the same results.

@JaviBecerra
Copy link
Member

Hi @palousegeo, no worries.

We have tried reinstalling QGis with the OSGEO4Wx64 "Express Desktop" install and we still can not reproduce the issue. Are you using any particular options during install?
Could you try with the QGis standalone installer?

@palousegeo
Copy link
Author

Hi,
I finally have something useful to report. All of my QGIS installs used the OSGEO4Wx64 “Advanced” package. I had added many of the additional libraries available through that installation option. I uninstalled the OSGEO4W package and replaced it with the “Express” version. This kept my existing plugins, but deleted the extra libraries. Under this scenario the Profile tool runs as expected. Unfortunately, I can’t point to what the conflict is since there are too many options with the “Advanced” package.

@JaviBecerra
Copy link
Member

Thanks @palousegeo, that explains why we are not able to reproduce it.
If you can provide us with a list of the options that you modify with regards to the default configuration options in advanced mode we can give it a try to find out the culprit, but this will surely take us some time.

@Aewaterhouse
Copy link

Hi,
I was also experiencing the same issues as described by @palousegeo, and have also managed to resolve it by changing the Osgeo4W setup from "Advanced" mode to the "Express Desktop" mode.
To reproduce my issue, I was previously selecting all the packages for installation.
Regards,
Alex

@JaviBecerra
Copy link
Member

Thanks to @Aewaterhouse report we have been able to reproduce the issue on one of our machines, selecting all packages during installation.
We have isolated the offending call somewhere down to this import on profileplugin.py:

from .tools.profiletool_core import ProfileToolCore

Moving it to line 90 (i.e. importing class ProfileToolCore right before using it), the crash is delayed until we try to open the plugin window, but there are no more problems during installation of the plugin or when opening QGis.

However profiletool_core.py is a rather complex module, not sure where the problem comes from yet. We'll keep on digging...

@dd-a
Copy link

dd-a commented May 9, 2019

I have the same crash on a Mac (Mac OS 10.13.6 ) with QGis 3.4.7 and 3.6.2 from Homebrew/Lutraconsulting. However iIt does not crash with QGis 3.4.7 from Kyngchaos (QGis official distribution). Here are the differences I see

Kyngchaos (compatible with Profile Tool)

  • Version de QGIS | 3.4.7-Madeira |
  • Compilé avec Qt | 5.11.2 | Utilisant Qt | 5.11.2
  • Compilé avec GDAL/OGR | 2.4.1 | Utilisé avec GDAL/OGR | 2.4.1
  • Compilé avec GEOS | 3.7.1-CAPI-1.11.0 | Utilisé avec GEOS | 3.7.1-CAPI-1.11.1 27a5e771
  • Version du client PostgreSQL | 9.6.10 | Version de SpatiaLite | 4.4.0-RC1
  • Version de QWT | 6.1.3 | Version de QScintilla2 | 2.10.8
  • Compilé avec PROJ | 520 | Fonctionne avec PROJ | 5.2.0

Homebrew (NOT compatible with Profile Tool)

  • Version de QGIS | 3.4.7-Madeira | Révision du code | 5c56989325
  • Compilé avec Qt | 5.12.2 | Utilisant Qt | 5.12.2
  • Compilé avec GDAL/OGR | 2.4.1 | Utilisé avec GDAL/OGR | 2.4.1
  • Compilé avec GEOS | 3.7.1-CAPI-1.11.1 | Utilisé avec GEOS | 3.7.1-CAPI-1.11.1 27a5e771
  • Version du client PostgreSQL | 11.2 | Version de SpatiaLite | 4.3.0a
  • Version de QWT | 6.1.3 | Version de QScintilla2 | 2.11.1
  • Compilé avec PROJ | 600 | Fonctionne avec PROJ | 6.0.0

It's on the same computer with the same user profile.

HTH

JaviBecerra added a commit that referenced this issue May 9, 2019
Remove hdf5 support (which was unused anyway) from the copy of pyqtgraph bundled with the plugin to avoid crashes seemingly due to conflicting hdf5 libraries bundled under different QGis packages.
This commit should solve issue #23
@JaviBecerra
Copy link
Member

Hi,
I think that we have finally pinned down the source of crashes.
Thanks to another crash report with a similar trace (see NeurodataWithoutBorders/api-python#28) we could link PyInit__conv to an hdf5 related library, which profiletool does not need but is anyway imported by the copy of pyqtgraph bundled with the plugin.
Many libraries incorporate hdf5 support, and it would seem that there may be some conflicts when they are compiled against or even bundling different dll versions (when using Os4Geo 'install all packages' option I find at least 12 hdf5 related dlls, including 3 different copies with different sizes of hdf5.dll or hdf5_hl.dll).

So, we have removed hdf5 support from the bundled pyqtgraph library on commit 6a47bb0
This solves the issue on our test machine (though there is still a nasty error message when closing QGis after using profiletool :/ ).
If @palousegeo and @dd-a can confirm that installing the latest version solves the issue we will close it and publish the updated version to QGis repos.

@dd-a
Copy link

dd-a commented May 9, 2019

No more crashes, tested with QGis 3.4.7 and 3.6.2 . Thank you very much !

@JaviBecerra
Copy link
Member

Cool @dd-a, you are welcome!
Thanks @palousegeo, @Aewaterhouse and @dd-a for your help!
I am closing the issue now, we will be publishing an updated version to QGis repos next week to solve this.
Feel free to reopen it you find this stacktrace again (or a similar one with a PyInit__conv call on the first line of the trace).
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants