Bug report #15369

layer rendering very slow and QGIS crashes with large number of rule based symbology classes

Added by Chris Freyberg over 7 years ago. Updated about 7 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Symbology
Affected QGIS version:2.16.1 Regression?:No
Operating System:Windows, OsX Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:Yes Copied to github as #:23300

Description

New description:

  • Take a layer with a column that ca be used to create a categorized symbology with a large (ex > 355) number of symbology classes
  • Create the categorized symbology
  • So far so good, the layer renders as expected
  • Now in vector properties change the symbology renderer to "rule based": the previous classes are used to create single rules
  • Now the layer takes ages to render
  • Moreover now if you open a project with a layer with such symbology configuration it will cause QGIS 2.16 64 bit on Windows/OsX to crash (but not on Linux nor on 32 QGIS Windows).
  • The same project on Windows and QGIS 2.8 64 bit didn't caused any crash.

Old description:
QGIS browser crashes when rendering a layer with a large (1500 item) rule set. If the rule set is reduced sufficiently (355 items max) then the layer renders, but adding back any additional rule to the 355 items seems to cause the crash. The problem is reproducible.

The browser was built with Mac Ports.

The trace (I am no expert ) appears to indicate the problem is in org.qgis.qgis2_core QgsSqlExpressionCompiler::compileNode().

The project (.qgs plus referenced data) is stable (since 2 yrs) and sizeable (2.7GB, 20+ layers). Probably it could be trimmed down to just one or two layers and still exhibit the problem.

Please note that I am just a user of the project, not the owner (or a developer).

NewZealand_250K_geology.qgs - Project file (2.79 MB) Chris Freyberg, 2016-07-31 02:34 PM

qgisBug.zip - Trace + project file (129 KB) Chris Freyberg, 2016-07-31 04:06 PM

History

#1 Updated by Chris Freyberg over 7 years ago

Attach trace file

#2 Updated by Chris Freyberg over 7 years ago

Same issue affects 64-bit build of 2.16.0 for Windows (Windows 10) BUT NOT the 32-bit build. See #15371 (closed as duplicate).

#3 Updated by Giovanni Manghi over 7 years ago

  • Status changed from Open to Feedback

could you please attach a sample project+data? thanks!

#4 Updated by Chris Freyberg over 7 years ago

Single layer project attached.

I'd ask you to please note that this project is a hack(subset) of an original that I am neither the owner, nor a developer of. The owner's rights are still active.

#5 Updated by Chris Freyberg over 7 years ago

Oops. It seems the attachment( single layer project complete ) failed to upload, probably because it is 7.1MB and the limit is 5MB per item.

I have no way of reducing the project further.

I will send the attachment direct to you, Giovanni.

#6 Updated by Giovanni Manghi over 7 years ago

  • Category changed from Browser to Symbology
  • Subject changed from Crashes rendering large rule set to layer rendering very slow and QGIS crashes with large number of rule based symbology classes
  • Priority changed from High to Severe/Regression
  • Affected QGIS version changed from 2.16.0 to 2.16.1
  • OS version deleted (10.10.5)
  • Operating System changed from OSX to Windows, OsX
  • Status changed from Feedback to Open

New description added.

#7 Updated by Andre Jesus over 7 years ago

I'm not sure if this is related but performance in 2.14.x and 2.16.x are half 2.8.x were.

#8 Updated by Andreas Neumann over 7 years ago

I can confirm that changing from categorized to rule based renderer with a large number of rules makes rendering magnitudes slower.

Tested on 2.x. master

#9 Updated by Chris Freyberg over 7 years ago

Updates made by other people to this ticket appear to suggest that the reported issue was slow rendering. In fact the original issue was a crash, probably a stack overflow (and, I'm guessing, probably due to right operand recursion when compiling the rule set) that occurs in some builds only. It seems to me unlikely that the crash and slow rendering have the same cause. Can the moderator please determine or split the ticket?

#10 Updated by Giovanni Manghi about 7 years ago

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

Chris Freyberg wrote:

Updates made by other people to this ticket appear to suggest that the reported issue was slow rendering. In fact the original issue was a crash, probably a stack overflow (and, I'm guessing, probably due to right operand recursion when compiling the rule set) that occurs in some builds only. It seems to me unlikely that the crash and slow rendering have the same cause. Can the moderator please determine or split the ticket?

so back to the crash. I have tested on QGIS 2.18.4 and master 64 bit on Windows and the crash is not replicable. I assume/hope that this problem is fixed. Please reopen if necessary.

About the slowness after applying the rule based renderer for hundreds of rules: feel free to file a ticket, personally I think that would be a "won't fix". After all for such cases the categorized symbology is what is needed.

Also available in: Atom PDF