Bug report #17876

layouts: crasher when deleting label items

Added by Mathieu Pellerin - nIRV over 6 years ago. Updated about 6 years ago.

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

Description

Every now and then, QGIS crashes when I delete a layout label item (* it might happen with other items, I've just not seen it with anything but labels).

Here's the gdb where output:

#0  0x00007ffff4476089 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x00007ffff44765e7 in QObject::disconnectImpl(QObject const*, void**, QObject const*, void**, QMetaObject const*) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007ffff198da27 in QObject::disconnect<void (QgsLayoutItem::*)(), void (QgsLayoutItemPropertiesWidget::*)()>(QtPrivate::FunctionPointer<void (QgsLayoutItem::*)()>::Object const*, void (QgsLayoutItem::*)(), QtPrivate::FunctionPointer<void (QgsLayoutItemPropertiesWidget::*)()>::Object const*, void (QgsLayoutItemPropertiesWidget::*)()) (sender=0x555560b78190, signal=(void (QgsLayoutItem::*)(QgsLayoutItem * const)) 0x7ffff6721420 <QgsLayoutItem::sizePositionChanged()>, receiver=0x55555f3a2f50, slot=(void (QgsLayoutItemPropertiesWidget::*)(QgsLayoutItemPropertiesWidget * const)) 0x7ffff19806b0 <QgsLayoutItemPropertiesWidget::setValuesForGuiPositionElements()>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:372
#3  0x00007ffff197f39b in QgsLayoutItemPropertiesWidget::setItem(QgsLayoutItem*) (this=0x55555f3a2f50, item=0x55555faab120)
    at /home/webmaster/dev/cpp/QGIS/src/gui/layout/qgslayoutitemwidget.cpp:294
#4  0x00007ffff7532d4d in QgsLayoutLabelWidget::setNewItem(QgsLayoutItem*) (this=0x55555eda6d20, item=0x55555faab120)
    at /home/webmaster/dev/cpp/QGIS/src/app/layout/qgslayoutlabelwidget.cpp:79
#5  0x00007ffff197da10 in QgsLayoutItemBaseWidget::setItem(QgsLayoutItem*) (this=0x55555eda6d20, item=0x55555faab120)
    at /home/webmaster/dev/cpp/QGIS/src/gui/layout/qgslayoutitemwidget.cpp:148
#6  0x00007ffff74d724a in QgsLayoutDesignerDialog::showItemOptions(QgsLayoutItem*, bool) (this=0x55555fd745a0, item=0x55555faab120, bringPanelToFront=true) at /home/webmaster/dev/cpp/QGIS/src/app/layout/qgslayoutdesignerdialog.cpp:887
#7  0x00007ffff74da07e in QgsLayoutDesignerDialog::undoRedoOccurredForItems(QSet<QString>) (this=0x55555fd745a0, itemUuids=...)
    at /home/webmaster/dev/cpp/QGIS/src/app/layout/qgslayoutdesignerdialog.cpp:1458
#8  0x00007ffff751a467 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QSet<QString> >, void, void (QgsLayoutDesignerDialog::*)(QSet<QString>)>::call(void (QgsLayoutDesignerDialog::*)(QSet<QString>), QgsLayoutDesignerDialog*, void**) (f=
    (void (QgsLayoutDesignerDialog::*)(QgsLayoutDesignerDialog * const, QSet<QString>)) 0x7ffff74d9f56 <QgsLayoutDesignerDialog::undoRedoOccurredForItems(QSet<QString>)>, o=0x55555fd745a0, arg=0x7fffffffcae0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:136
#9  0x00007ffff75196c6 in QtPrivate::FunctionPointer<void (QgsLayoutDesignerDialog::*)(QSet<QString>)>::call<QtPrivate::List<QSet<QString> >, void>(void (QgsLayoutDesignerDialog::*)(QSet<QString>), QgsLayoutDesignerDialog*, void**) (f=
    (void (QgsLayoutDesignerDialog::*)(QgsLayoutDesignerDialog * const, QSet<QString>)) 0x7ffff74d9f56 <QgsLayoutDesignerDialog::undoRedoOccurredForItems(QSet<QString>)>, o=0x55555fd745a0, arg=0x7fffffffcae0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:169
#10 0x00007ffff751845d in QtPrivate::QSlotObject<void (QgsLayoutDesignerDialog::*)(QSet<QString>), QtPrivate::List<QSet<QString> >, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x55555ef560c0, r=0x55555fd745a0, a=0x7fffffffcae0, ret=0x0)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:120
#11 0x00007ffff44739ff in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff67272ac in QgsLayoutUndoStack::undoRedoOccurredForItems(QSet<QString>) (this=0x555560af31f0, _t1=...)
    at /home/webmaster/dev/cpp/QGIS/bm-qt5/src/core/layout/moc_qgslayoutundostack.cpp:150
#13 0x00007ffff64e98c4 in QgsLayoutUndoStack::indexChanged() (this=0x555560af31f0)
    at /home/webmaster/dev/cpp/QGIS/src/core/layout/qgslayoutundostack.cpp:117
#14 0x00007ffff64eac8c in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (QgsLayoutUndoStack::*)()>::call(void (QgsLayoutUndoStack::*)(), QgsLayoutUndoStack*, void**) (f=(void (QgsLayoutUndoStack::*)(QgsLayoutUndoStack * const)) 0x7ffff64e986a <QgsLayoutUndoStack::indexChanged()>, o=0x555560af31f0, arg=0x7fffffffcd20) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:136

Associated revisions

Revision fe13c0e8
Added by Nyall Dawson over 6 years ago

Fix crash when deleting layout items

Fixes #17876, #17770

History

#1 Updated by Mathieu Pellerin - nIRV over 6 years ago

Nyall, the crasher happens when the item properties panel is open (and focused).

Seems the code is trying to disconnect on a QgsLayoutItem pointer that's already gone (which is odd since there's a if ( mItem ) check in there.

#2 Updated by Mathieu Pellerin - nIRV over 6 years ago

Steps to reproduce
  1. Create an empty layout
  2. Add a label item onto the layout view
  3. Add a second label item onto the layout view
  4. Click on the page background to make sure no item is selected
  5. Mouse click to select the second label item on the layout view
  6. Then, mouse click to select the first label item on the layout view
  7. Hit the "del" keyboard key to delete the first label item
  8. Mouse click on the second label item
  9. boom QGIS dies

#3 Updated by Mathieu Pellerin - nIRV over 6 years ago

  • Subject changed from layouts: sporadic crasher when deleting label items to layouts: crasher when deleting label items

#4 Updated by Jan Lippmann over 6 years ago

i can't reproduce the crash under win 7 64bit. (tryed it for 6 times)


QGIS version
2.99.0-Master
QGIS code revision
4a2da5006b
Compiled against Qt
5.9.2
Running against Qt
5.9.2
Compiled against GDAL/OGR
2.2.3
Running against GDAL/OGR
2.2.3
Compiled against GEOS
3.5.0-CAPI-1.9.0
Running against GEOS
3.5.0-CAPI-1.9.0 r4084
PostgreSQL Client Version
9.2.4
SpatiaLite Version
4.3.0
QWT Version
6.1.3
PROJ.4 Version
493
QScintilla2 Version
2.10.1
This copy of QGIS writes debugging output.

#5 Updated by Nyall Dawson over 6 years ago

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

#6 Updated by Giovanni Manghi about 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF