Bug report #15684

Crash when creating snapshot with vector layer from command line

Added by Alex Cobb almost 8 years ago. Updated over 5 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:2.18.16 Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:23607

Description

Creating a PNG snapshot from the command line on Linux of a map containing a vector layer causes a segmentation fault after creating the PNG. Crashes with projects containing either SpatiaLite and shapefile layers, but no crash with just a raster layer (GeoTIFF). No crash if creating a PNG from the GUI (Project -> Save As Image...). Crashes with or without --noplugins, --extent, --height, or --width. A number of failed Gtk assertions are reported just before the segfault. The attached minimal (not) working example consists of a project containing a single vector layer that is just a single polygon that I created in QGIS:

qgis --snapshot output.png test_map.qgsWarning: loading of qgis translation failed [/usr/share/qgis/i18n//qgis_en_US]
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
Warning: QCss::Parser - Failed to load file  "/style.qss" 
loaded the Generic plugin 
Warning: QObject::startTimer: QTimer can only be used with threads started with QThread

(qgis:11254): Gtk-CRITICAL **: IA__gtk_container_add: assertion 'GTK_IS_CONTAINER (container)' failed

(qgis:11254): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(These two assertion failures are reported many times; full output is attached.)
Segmentation fault (core dumped)

test_map.qgs - Minimal map causing segfault on snapshot (7.57 KB) Alex Cobb, 2016-10-09 09:56 AM

example.shp - Minimal vector layer causing segfault on snapshot (one polygon) (252 Bytes) Alex Cobb, 2016-10-09 09:56 AM

example.shx - Auxiliary file for minimal vector layer (108 Bytes) Alex Cobb, 2016-10-09 09:56 AM

example.dbf - Auxiliary file for minimal vector layer (188 Bytes) Alex Cobb, 2016-10-09 09:56 AM

example.prj - Auxiliary file for minimal vector layer (143 Bytes) Alex Cobb, 2016-10-09 09:56 AM

example.qpj - Auxiliary file for minimal vector layer (257 Bytes) Alex Cobb, 2016-10-09 09:56 AM

snapshot_crash_stderr.txt Magnifier - Errors reported to standard error (13.5 KB) Alex Cobb, 2016-10-09 09:56 AM

backtrace.log Magnifier - Stack trace (35 KB) Alex Cobb, 2016-10-09 09:56 AM

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

  • Affected QGIS version changed from 2.12.1 to 2.18.4
  • Target version set to Version 2.18

Confirmed on 2.18.4

#3 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#4 Updated by Luca Lanteri over 6 years ago

It works with 3.0.
Confirmed on 2.18.15

#5 Updated by Giovanni Manghi over 6 years ago

  • Description updated (diff)
  • Affected QGIS version changed from 2.18.4 to 2.18.16

#6 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Luca Lanteri wrote:

It works with 3.0.
Confirmed on 2.18.15

2.18 is EOL, so closing

Also available in: Atom PDF