Bug report #17077

QGIS Crashes when using SVG marker for point layer in map units or with rotation

Added by Olcay Ebcin over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:High
Assignee:Nyall Dawson
Category:Symbology
Affected QGIS version:2.18.12 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:24976

Description

Have more than 5000 point features and show it as SVG marker.

Give any rotation angle. (ie 45 degree)
make some Zoom in and Zoom out, then Ooops Oh! Uh!, QGIS's gone :(

Keep SVG markers in MapUnit.
make zoom in and zoom out, then again Ooops Oh! Uh!, QGIS's gone again :(

points.zip (191 KB) Giovanni Manghi, 2017-08-27 05:12 PM

stacktrace.txt Magnifier (120 KB) Alessandro Pasotti, 2017-09-22 10:49 AM

stacktrace2.txt Magnifier (143 KB) Alessandro Pasotti, 2017-09-22 01:13 PM

Associated revisions

Revision a6eea720
Added by Nyall Dawson over 6 years ago

Fix crashes caused by concurrent rendering of cached QPictures from QgsSvgCache

QgsSvgCache::svgAsPicture was rendering an implicitly shared copy when
the picture had already been cached. It turns out that rendering an
implicitly shared QPicture copy isn't thread safe, and rendering shared
copies simulataneously across different threads leads quickly to a crash.

Accordingly we always detach the QPicture objects returned by
svgAsPicture, so that the returned QPicture is safe to use across threads.

Also add unit tests for this, and a similar unit test to verify that
rendering of QImage based cached copies does not suffer the same
issue.

Fixes #17089, #17077

History

#1 Updated by Nyall Dawson over 6 years ago

  • Assignee deleted (Nyall Dawson)

#2 Updated by Giovanni Manghi over 6 years ago

  • File points.zip added
  • Subject changed from SVG marker in MapUnit or give Rotation angle in QGIS 3.0 to QGIS Crashes when using SVG marker fpr point layer in MapUnit or with rotation angle
  • Affected QGIS version changed from master to 2.18.12
  • Regression? changed from No to Yes

This also affects 2.18.12 but not 2.14, regression. Layer attached.

#3 Updated by Giovanni Manghi over 6 years ago

  • Subject changed from QGIS Crashes when using SVG marker fpr point layer in MapUnit or with rotation angle to QGIS Crashes when using SVG marker for point layer in map units or with rotation

#4 Updated by Alessandro Pasotti over 6 years ago

  • Assignee set to Alessandro Pasotti

#5 Updated by Alessandro Pasotti over 6 years ago

Confirmed on latest 2.18.
The debugger does not produce any meaningful information (at least for me) but I attach the stacktrace.

Master looks fine.

#6 Updated by Alessandro Pasotti over 6 years ago

Now crashing in a different place:
src/core/qgsvectorlayerrenderer.cpp: 291: (drawRendererV2) [0ms] [thread:0x7fff0000b3d0] Drawing of vector layer points20170922130742064 cancelled.
src/core/qgsmaprendererparalleljob.cpp: 279: (renderLayerStatic) [0ms] [thread:0x7fff0000b3d0] job e66b450 end [29 ms] (layer points20170922130742064)
  • Error in `/home/ale/dev/QGIS/build-local/output/bin/qgis': malloc(): smallbin double linked list corrupted: 0x000000000a8634e0 ***

See attached stacktrace2.txt

#7 Updated by Alessandro Pasotti over 6 years ago

I can confirm that it only happens when multi-threaded rendering options is ON (confirmed on Windows that it's the most easy to crash).

#8 Updated by Nyall Dawson over 6 years ago

  • Assignee set to Nyall Dawson

#10 Updated by Nyall Dawson over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF