Bug report #16470

crash when using legend "show feature count"

Added by Mathieu Pellerin - nIRV about 7 years ago. Updated almost 7 years ago.

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

Description

Subject says it all.

Steps to reproduce
  1. Open attached crash.qgs project
  2. Open style dock, select the single vector layer in the project
  3. Go to the label section in the style dock, and click on the label with's [ E ] expression button
  4. boom crash

gdb where output

#0  0x0000000000000000 in  ()
#1  0x00007ffff574986b in QgsDefaultVectorLayerLegend::createLayerTreeModelLegendNodes(QgsLayerTreeLayer*) (this=0x555558726070, nodeLayer=0x555558889f00)
    at /home/webmaster/dev/cpp/QGIS/src/core/qgsmaplayerlegend.cpp:202
#2  0x00007ffff55352a6 in QgsLayerTreeModel::addLegendToLayer(QgsLayerTreeLayer*) (this=0x5555565b24f0, nodeL=0x555558889f00) at /home/webmaster/dev/cpp/QGIS/src/core/layertree/qgslayertreemodel.cpp:1202
#3  0x00007ffff55310f3 in QgsLayerTreeModel::refreshLayerLegend(QgsLayerTreeLayer*) (this=0x5555565b24f0, nodeLayer=0x555558889f00) at /home/webmaster/dev/cpp/QGIS/src/core/layertree/qgslayertreemodel.cpp:533
#4  0x00007ffff55327a0 in QgsLayerTreeModel::layerLegendChanged() (this=0x5555565b24f0) at /home/webmaster/dev/cpp/QGIS/src/core/layertree/qgslayertreemodel.cpp:803
#5  0x00007ffff55400e2 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (QgsLayerTreeModel::*)()>::call(void (QgsLayerTreeModel::*)(), QgsLayerTreeModel*, void**) (f=(void (QgsLayerTreeModel::*)(QgsLayerTreeModel * const)) 0x7ffff55326f2 <QgsLayerTreeModel::layerLegendChanged()>, o=0x5555565b24f0, arg=0x7fffffffb230) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:141
#6  0x00007ffff553f303 in QtPrivate::FunctionPointer<void (QgsLayerTreeModel::*)()>::call<QtPrivate::List<>, void>(void (QgsLayerTreeModel::*)(), QgsLayerTreeModel*, void**) (f=(void (QgsLayerTreeModel::*)(QgsLayerTreeModel * const)) 0x7ffff55326f2 <QgsLayerTreeModel::layerLegendChanged()>, o=0x5555565b24f0, arg=0x7fffffffb230) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:160
#7  0x00007ffff553d8f7 in QtPrivate::QSlotObject<void (QgsLayerTreeModel::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555558cba4d0, r=0x5555565b24f0, a=0x7fffffffb230, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:120
#8  0x00007ffff3d8a81e in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff5c18075 in QgsMapLayer::legendChanged() (this=0x55555879f4c0) at /home/webmaster/dev/cpp/QGIS/bm-qt5/src/core/moc_qgsmaplayer.cpp:430
#10 0x00007ffff5747ede in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (QgsMapLayer::*)()>::call(void (QgsMapLayer::*)(), QgsMapLayer*, void**) (f=(void (QgsMapLayer::*)(QgsMapLayer * const)) 0x7ffff5c1804c <QgsMapLayer::legendChanged()>, o=0x55555879f4c0, arg=0x7fffffffb410) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:141
#11 0x00007ffff5747bda in QtPrivate::FunctionPointer<void (QgsMapLayer::*)()>::call<QtPrivate::List<>, void>(void (QgsMapLayer::*)(), QgsMapLayer*, void**) (f=(void (QgsMapLayer::*)(QgsMapLayer * const)) 0x7ffff5c1804c <QgsMapLayer::legendChanged()>, o=0x55555879f4c0, arg=0x7fffffffb410) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:160
#12 0x00007ffff5747403 in QtPrivate::QSlotObject<void (QgsMapLayer::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555558c47500, r=0x55555879f4c0, a=0x7fffffffb410, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:120
#13 0x00007ffff3d8a81e in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff5c185f9 in QgsMapLayerLegend::itemsChanged() (this=0x555558726070) at /home/webmaster/dev/cpp/QGIS/bm-qt5/src/core/moc_qgsmaplayerlegend.cpp:125
#15 0x00007ffff574ae27 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (QgsMapLayerLegend::*)()>::call(void (QgsMapLayerLegend::*)(), QgsMapLayerLegend*, void**) (f=(void (QgsMapLayerLegend::*)(QgsMapLayerLegend * const)) 0x7ffff5c185d0 <QgsMapLayerLegend::itemsChanged()>, o=0x555558726070, arg=0x7fffffffb5f0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:141
#16 0x00007ffff574adaa in QtPrivate::FunctionPointer<void (QgsMapLayerLegend::*)()>::call<QtPrivate::List<>, void>(void (QgsMapLayerLegend::*)(), QgsMapLayerLegend*, void**) (f=(void (QgsMapLayerLegend::*)(QgsMapLayerLegend * const)) 0x7ffff5c185d0 <QgsMapLayerLegend::itemsChanged()>, o=0x555558726070, arg=0x7fffffffb5f0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:160
#17 0x00007ffff574ac93 in QtPrivate::QSlotObject<void (QgsMapLayerLegend::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555558c47220, r=0x555558726070, a=0x7fffffffb5f0, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:120
#18 0x00007ffff3d8a81e in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007ffff5c1801d in QgsMapLayer::rendererChanged() (this=0x55555879f4c0) at /home/webmaster/dev/cpp/QGIS/bm-qt5/src/core/moc_qgsmaplayer.cpp:418
#20 0x00007ffff590f7d9 in QgsVectorLayer::setRenderer(QgsFeatureRenderer*) (this=0x55555879f4c0, r=0x55555aaa2d20) at /home/webmaster/dev/cpp/QGIS/src/core/qgsvectorlayer.cpp:2721
#21 0x00007ffff5908ca3 in QgsVectorLayer::readStyle(QDomNode const&, QString&) (this=0x55555879f4c0, node=..., errorMessage=...) at /home/webmaster/dev/cpp/QGIS/src/core/qgsvectorlayer.cpp:1856
#22 0x00007ffff73fa8e7 in QgsMapLayerStyleCommand::redo() (this=0x55555aaaa260) at /home/webmaster/dev/cpp/QGIS/src/app/qgslayerstylingwidget.cpp:524
#23 0x00007ffff4da83e8 in QUndoStack::push(QUndoCommand*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff73fa612 in QgsLayerStylingWidget::pushUndoItem(QString const&) (this=0x5555566f0f60, name=...) at /home/webmaster/dev/cpp/QGIS/src/app/qgslayerstylingwidget.cpp:499
#25 0x00007ffff73f919a in QgsLayerStylingWidget::apply() (this=0x5555566f0f60) at /home/webmaster/dev/cpp/QGIS/src/app/qgslayerstylingwidget.cpp:265
#26 0x00007ffff73ff0c5 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (QgsLayerStylingWidget::*)()>::call(void (QgsLayerStylingWidget::*)(), QgsLayerStylingWidget*, void**) (f=(void (QgsLayerStylingWidget::*)(QgsLayerStylingWidget * const)) 0x7ffff73f8e12 <QgsLayerStylingWidget::apply()>, o=0x5555566f0f60, arg=0x7fffffffbaa0)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:141
#27 0x00007ffff73fee06 in QtPrivate::FunctionPointer<void (QgsLayerStylingWidget::*)()>::call<QtPrivate::List<>, void>(void (QgsLayerStylingWidget::*)(), QgsLayerStylingWidget*, void**) (f=(void (QgsLayerStylingWidget::*)(QgsLayerStylingWidget * const)) 0x7ffff73f8e12 <QgsLayerStylingWidget::apply()>, o=0x5555566f0f60, arg=0x7fffffffbaa0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:160
#28 0x00007ffff73fe9e3 in QtPrivate::QSlotObject<void (QgsLayerStylingWidget::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555556711730, r=0x5555566f0f60, a=0x7fffffffbaa0, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:120
#29 0x00007ffff3d8a81e in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007ffff3d96e38 in QTimer::timerEvent(QTimerEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00007ffff3d8b313 in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#32 0x00007ffff4a3635c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#33 0x00007ffff4a3db11 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#34 0x00007ffff55b1a89 in QgsApplication::notify(QObject*, QEvent*) (this=0x7fffffffda00, receiver=0x555556707bc0, event=0x7fffffffbe50) at /home/webmaster/dev/cpp/QGIS/src/core/qgsapplication.cpp:295
#35 0x00007ffff3d5e8a0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#36 0x00007ffff3db1eae in QTimerInfoList::activateTimers() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#37 0x00007ffff3db2409 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#38 0x00007fffea4af377 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007fffea4af5e0 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007fffea4af68c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007ffff3db2f0f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#42 0x00007ffff3d5c88a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

crash.zip (2.68 MB) Mathieu Pellerin - nIRV, 2017-04-25 10:12 PM

History

#1 Updated by Mathieu Pellerin - nIRV about 7 years ago

You can also crash QGIS by simply opening the "label with"'s combo box list (via its drop down button).

#2 Updated by Mathieu Pellerin - nIRV about 7 years ago

Upon further inquiry, the crasher appears to be linked to map themes. If the map view is set to the "(default)" theme, QGIS won't crash when going through the steps above. If the map view is then set back to "migration" theme, it'll die.

#3 Updated by Giovanni Manghi about 7 years ago

  • Category set to Labelling

#4 Updated by Giovanni Manghi about 7 years ago

  • Regression? set to Yes

#5 Updated by Giovanni Manghi about 7 years ago

  • Priority changed from Severe/Regression to High

#6 Updated by Giovanni Manghi about 7 years ago

  • Easy fix? set to No

#7 Updated by Mathieu Pellerin - nIRV about 7 years ago

  • Description updated (diff)

FYI, I'm not sure Labelling is the right category -- the problem seems to be rooted in map themes, and possibly interactions with style dock. The labelling UI (coupled with map views) is simply the way through which it's triggered.

#8 Updated by Nyall Dawson about 7 years ago

  • Subject changed from crash when opening labelling's expression dialog when a map view panel is open to crash when using legend "show feature count"
  • Category changed from Labelling to Vectors
  • Assignee deleted (Nyall Dawson)

Crash is actually caused by the "show feature count" option in legends - disabling this option in the layer tree + all composer legends = no crash

#9 Updated by Mathieu Pellerin - nIRV almost 7 years ago

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

Also available in: Atom PDF