Bug report #15546

Crash when rendering a polygon layer with style and labels

Added by Stefan Schweigel almost 8 years ago. Updated over 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Map Canvas
Affected QGIS version:2.18.13 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data:Yes Copied to github as #:23469

Description

We currently migrating our environment from QGis 2.8.1 to QGis 2.14.6. Under QGis 2.8.1 everything works fine, even if I reopen the 2.14-project under version 2.8!

Under QGis 2.14.6 we had unexplainable "randomly" crashes when zooming and panning in the main window. The Crash also occurs "randomly" when we try to generate maps with the Atlas-Tool

After a while I could narrow down the problem to a polygon layer. I don’t know exactly why it crashes, but I guess it has something to do with the “new” styling and labeling features. By adding the shape file (Layer B, see below) to the project without styling the problem does not occur.

Steps to reproduce the crash:
- open the attached sample project (contains sample data of the region where the problem occurs)
- you see a red point. Try to zoom in! (under scale 1:100,000)

Alternative:
- open the Map-Composer “GIS-Bild” and try to enable the preview of the Atlas

Or:
- disable the “Set Layer Scale Visibility” for Layer B

Now it becomes strange:
If you set “Toggle Editing” = On for Layer B zoom, pan and Atlas-Tool are working fine (all my > 4000 images are created without problems). But this can’t be the solution, because you cannot open a project with editing toggled ON for “Layer B”. QGis will immediately crash when opening a project saved with deep zoom.

Some remarks to “Layer B”
- originally it is an MSSQL layer, the problem is the same with shp file and MSSQL table
- in Sql-Server all geometry are “Valid”, “Simple” and type “Polygon”

I also added two core dumps from the crashes

project_sample.zip (206 KB) Stefan Schweigel, 2016-09-08 04:56 AM

dump1.zip (3.63 MB) Stefan Schweigel, 2016-09-08 04:56 AM

dump2.zip (3.63 MB) Stefan Schweigel, 2016-09-08 04:56 AM

sample crash V2.18.13.zip (208 KB) Stefan Schweigel, 2017-10-19 04:02 PM

sample works.zip (205 KB) Stefan Schweigel, 2017-10-19 04:02 PM

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Priority changed from Normal to High

#2 Updated by Giovanni Manghi over 7 years ago

  • Status changed from Open to Closed
  • Resolution set to not reproducable

cannot replicate in any of the scenarios (with the provided data and project) on qgis 2.18.4

Please reopen if necessary.

#3 Updated by Stefan Schweigel over 6 years ago

  • Status changed from Closed to Reopened

The Problem is still the same in QGIS 2.18.13

Steps to reproduce the crash:
- open the attached sample project
- you see a red point. Try to zoom in! (under scale 1:100,000)

#4 Updated by Giovanni Manghi over 6 years ago

  • Affected QGIS version changed from 2.14.5 to 2.18.13
  • Description updated (diff)
  • Status changed from Reopened to Feedback

Stefan Schweigel wrote:

The Problem is still the same in QGIS 2.18.13

Steps to reproduce the crash:
- open the attached sample project
- you see a red point. Try to zoom in! (under scale 1:100,000)

I just tried on a clean 2.18.13 installation (try with no 3rd party plugins, or remove the .qgis2 folder) and there is no crash after opening the project (there is a missing WMS layer, can be a factor?) and zooming in/out even very quickly.

On the other hand If I open the included composer there is a crash when enbaling the atlas preview... but if I change the CRS of the project to something like 4326 then there is no crash. The project comes defined with a custom CRS.

The layer "B" has no scale dependent visibility enabled upon opening the project.

Please leave more feedback if possible.

#5 Updated by Stefan Schweigel over 6 years ago

It seems to be a very strange problem. I tried your suggestions: removed the .qgis2 folder and disabled all plugins. It works after the first start. I can zoom in without any problems. I closed QGIS and opened the project again --> Crash. I reopened the project again and changed the CRS to WGS84 (4326) ... it works ... changed the CRS to UTM32N (25832) --> Crash. I enabled and disabled some plugins, but I cannot figure out if one the plugins maybe the reason for the crash. Activated are:
db_manager
georefplugin.dll
processing

I think it is not a clean 2.18.13 installation. Our IT department has installed the program. I have no influence over them

I don’t think that the missing WMS layer is the reason for the crash. Because I saved the project after loading under another name (see attachment "sample crash V2.18.13.zip"), then closed QGIS and opened this resaved project --> zoom in = crash.

The custom CRS is EPSG 2398 (http://spatialreference.org/ref/epsg/2398/). The older QGIS versions shipped with wrong parameters for EPSG 2398, which resulted in an offset of ~ 3 meters. In QGIS 2.18 the shipped EPSG 2398 is better, but not the same described at spatialreference.org. The offset now is < 25 cm.
I changed the OTF projection to 4326 and saved the project again (see attachment "sample works.zip"). After closing QGIS I opened this project and it works. Even if I change the OTF projection back to the custom CRS and reopen this project. I don’t know if this is a solution for this issue.

The description above was a little bit wrong. Layer "F" is the reason for the problem. You may replace "B" with "F" in the description above. B contains only one point to mark the location of the problem

The only safe workaround for the problem is to set “Toggle Editing” = On for Layer F

#6 Updated by Giovanni Manghi over 6 years ago

  • Resolution deleted (not reproducable)
  • Subject changed from QGis 2.14.6 crashes with dump when rendering a polygon layer with style and labels to Crash when rendering a polygon layer with style and labels

Stefan Schweigel wrote:

It seems to be a very strange problem. I tried your suggestions: removed the .qgis2 folder and disabled all plugins. It works after the first start. I can zoom in without any problems. I closed QGIS and opened the project again --> Crash. I reopened the project again and changed the CRS to WGS84 (4326) ... it works ... changed the CRS to UTM32N (25832) --> Crash. I enabled and disabled some plugins, but I cannot figure out if one the plugins maybe the reason for the crash. Activated are:
db_manager
georefplugin.dll
processing

I think it is not a clean 2.18.13 installation. Our IT department has installed the program. I have no influence over them

I don’t think that the missing WMS layer is the reason for the crash. Because I saved the project after loading under another name (see attachment "sample crash V2.18.13.zip"), then closed QGIS and opened this resaved project --> zoom in = crash.

The custom CRS is EPSG 2398 (http://spatialreference.org/ref/epsg/2398/). The older QGIS versions shipped with wrong parameters for EPSG 2398, which resulted in an offset of ~ 3 meters. In QGIS 2.18 the shipped EPSG 2398 is better, but not the same described at spatialreference.org. The offset now is < 25 cm.
I changed the OTF projection to 4326 and saved the project again (see attachment "sample works.zip"). After closing QGIS I opened this project and it works. Even if I change the OTF projection back to the custom CRS and reopen this project. I don’t know if this is a solution for this issue.

The description above was a little bit wrong. Layer "F" is the reason for the problem. You may replace "B" with "F" in the description above. B contains only one point to mark the location of the problem

The only safe workaround for the problem is to set “Toggle Editing” = On for Layer F

I'm not able to replicate the crash while doing zoom in/out, the style/visibility of layers is not a factor here on a clean testing environment. I ask kindly to try on another machine/environment.

On the other hand I see the crash when previewing the atlas with the included composer with some CRS (the custom CRS used by default by the project or by manually setting it to 2398 but not with 4326) BUT... if I try a new composer then there is no crash at all... suggesting some weird issue in the layout that comes with the project.

Please try confirm/dismiss the above. thanks!

#7 Updated by Stefan Schweigel over 6 years ago

The solution for this issue seems to be:
- change the OTF projection to 4326
- save the project as a different name
- close QGIS and reopen the saved project
- change the OTF projection back to the recently used projection (optional)

Zoom to "erroneous" geometry and atlas tool are still working.

I compared the two qgs project files ("crash" vs "works"). There are some differences while nothing else than the projection in the project was changed:
- cleaned the section <layer_coordinate_transform_info> from missing or old layers
- added the tag <WMSSegmentizeFeatureInfoGeometry type="bool">false</WMSSegmentizeFeatureInfoGeometry>

#8 Updated by Giovanni Manghi over 6 years ago

Can we close this as "won't fix" as probably caused by an unclean (and hard to replicate) project?

#9 Updated by Stefan Schweigel over 6 years ago

Yes close this issue

I believe it is because of the long use of a project file across different versions. Also, the save command does not seem to properly clean the project file of missing layers. But this is an other issue.

#10 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to wontfix
  • Status changed from Feedback to Closed

Also available in: Atom PDF