zoran-cuckovic / QGIS-terrain-shading

Modelling natural shading for elevation models in QGIS
GNU General Public License v3.0
72 stars 11 forks source link

Plugin causes segmentation fault in QGIS master #5

Closed saberraz closed 7 months ago

saberraz commented 4 years ago

To replicate: 1- Install QGIS master (3.13) 2- Go to Settings > Options 3- Under General > UI theme...change to another theme 4- QGIS crashes

For Step 3, other changes also cause seg fault (e.g. change locale).

Here is the gdb trace from the crash:

../src/app/qgsoptions.cpp:172 : (QgsOptions) [234ms] Standard Identify radius setting read from settings file: 2
../src/core/qgsmessagelog.cpp:29 : (logMessage) [10435ms] 2020-06-16T06:31:35 Python error[1] Traceback (most recent call last):
  File "/home/saber/.local/share/QGIS/QGIS3/profiles/default/python/plugins/TerrainShading/dem_shading_provider.py", line 80, in loadAlgorithms
    self.addAlgorithm( alg )
RuntimeError: wrapped C/C++ object of type DemShadingAlgorithm has been deleted

Thread 1 "qgis" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe2dcbf80 (LWP 2966004)]
0x0000000000000060 in ?? ()
abdulhafidz6 commented 3 years ago

I face the same problem. whenever I click OK from Options under Setting menu, a pop up will be appeared. Unfortunately, the message from the pop up is not seen since it closed the QGIS immediately.

zoran-cuckovic commented 3 years ago

Thank you for signalling the problem! I'm unable to replicate your errors (I work on 3.12). If you cannot see the message window, what makes you think that the Terrain Shading plugin is broken ? (What can you see ?)

abdulhafidz6 commented 3 years ago

Thank you for your response. I have some processing provider in my QGIS (Orfeo Toolbox, TauDEM, QGIS2treejs, SAGA). I thought it was from Taudem or Orfeo toolbox but it still crash until I deactivate Terrain Shading. I'm working with QGIS 3.10.11 and QGIS 3.16.1

zoran-cuckovic commented 3 years ago

The problem should be resolved by editing the line 50, in the file dem_shading_provider.py. Instead of calling : QgsProcessingProvider.__init__(self), it should rather be : super().__init__() I can't really explain what's going on here (class inheritance...), but it seems to resolve the problem.

abdulhafidz6 commented 3 years ago

Hi.. Thanks so much for your effort. It works with no issue.