Bug report #5932

Qgis crashes when removing a layergroup

Added by Victor Axbom over 2 years ago. Updated almost 2 years ago.

Status:Closed Start Date:07/03/2012
Priority:High Due date:
Assigned to:- % Done:

0%

Category:Map Legend
Target version:Version 2.0.0
Platform: Patch supplied:Yes
Platform version: Affected version:master
Status info: Causes crash or corruption:Yes
Resolution:fixed Tag:

Description

To reproduce the crash:
1. Add layers.
2. Select all layers.
3. Group the layers with the new Group selected options from right-click-menu.
4. Remove the group.
Qgis will crash, but only if there isn't any more layers left in the legend except from the group. The crash only occur when you create the group with the Group selected function, if you create a group and drag layers into it, the removal works fine.

0001-Proposal-for-Bugfix-5932.patch (974 Bytes) Thomas Arnold, 11/09/2012 12:30 pm

History

Updated by Giovanni Manghi over 2 years ago

  • Priority changed from Normal to High
  • Platform deleted (Windows)
  • Platform version deleted (XP)

Confirmed under Ubuntu.

Updated by John Tull over 2 years ago

Confirmed for me on Mac OS X.

Updated by Salvatore Larosa over 2 years ago

the same here on debian!

backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff2e46b09 in QUndoStack::clear() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
(gdb) bt
#0  0x00007ffff2e46b09 in QUndoStack::clear() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#1  0x0000000000719c29 in QgsUndoWidget::destroyStack (this=0x104fcf0)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/qgsundowidget.cpp:60
#2  0x0000000000719bf1 in QgsUndoWidget::layerChanged (this=0x104fcf0, layer=0x0)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/qgsundowidget.cpp:50
#3  0x000000000080c2fe in QgsUndoWidget::qt_static_metacall (_o=0x104fcf0, 
    _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffff99c0)
    at /home/sam/pacchetti_gis/Quantum-GIS/build-master/src/app/moc_qgsundowidget.cxx:61
#4  0x00007ffff34655cf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x0000000000811013 in QgsLegend::currentLayerChanged (this=0x1035060, _t1=0x0)
    at /home/sam/pacchetti_gis/Quantum-GIS/build-master/src/app/legend/moc_qgslegend.cxx:312
#6  0x000000000079c1f5 in QgsLegend::handleCurrentItemChanged (this=0x1035060, current=0x0, 
    previous=0x57be350) at /home/sam/pacchetti_gis/Quantum-GIS/src/app/legend/qgslegend.cpp:182
#7  0x0000000000810a93 in QgsLegend::qt_static_metacall (_o=0x1035060, 
    _c=QMetaObject::InvokeMetaMethod, _id=50, _a=0x7fffffff9cf0)
    at /home/sam/pacchetti_gis/Quantum-GIS/build-master/src/app/legend/moc_qgslegend.cxx:208
#8  0x00007ffff34655cf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#9  0x00007ffff2d7501f in QTreeWidget::currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007ffff34655cf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#11 0x00007ffff2d53ffa in QItemSelectionModel::currentChanged(QModelIndex const&, QModelIndex const&) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007ffff2d5770f in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x00007ffff2d5af49 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#14 0x00007ffff34655cf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#15 0x00007ffff34af264 in QAbstractItemModel::rowsAboutToBeRemoved(QModelIndex const&, int, int) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#16 0x00007ffff34473a6 in QAbstractItemModel::beginRemoveRows(QModelIndex const&, int, int) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#17 0x00007ffff2d73310 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff2d76882 in QTreeWidgetItem::~QTreeWidgetItem() ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#19 0x00000000007b0782 in QgsLegendItem::~QgsLegendItem (this=0x57be350, __in_chrg=<optimized out>)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/legend/qgslegenditem.cpp:37
#20 0x0000000000799b4d in QgsLegendGroup::~QgsLegendGroup (this=0x57be350, 
    __in_chrg=<optimized out>)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/legend/qgslegendgroup.cpp:51
#21 0x0000000000799b86 in QgsLegendGroup::~QgsLegendGroup (this=0x57be350, 
    __in_chrg=<optimized out>)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/legend/qgslegendgroup.cpp:52
#22 0x00000000007a32e4 in QgsLegend::removeGroup (this=0x1035060, lg=0x57be350)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/legend/qgslegend.cpp:1201
#23 0x00000000007aa940 in QgsLegend::removeSelectedLayers (this=0x1035060)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/legend/qgslegend.cpp:2435
#24 0x000000000057646a in QgisApp::removeLayer (this=0xf00e60)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/qgisapp.cpp:4982
#25 0x00000000007fe677 in QgisApp::qt_static_metacall (_o=0xf00e60, 
    _c=QMetaObject::InvokeMetaMethod, _id=59, _a=0x7fffffffa890)
    at /home/sam/pacchetti_gis/Quantum-GIS/build-master/src/app/moc_qgisapp.cxx:462
#26 0x00007ffff34655cf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#27 0x00007ffff27f3502 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#28 0x00007ffff27f36f0 in QAction::activate(QAction::ActionEvent) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#29 0x00007ffff2c2d753 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#30 0x00007ffff2c33a69 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#31 0x00007ffff2848ed0 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#32 0x00007ffff2c34d1b in QMenu::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#33 0x00007ffff27f970c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#34 0x00007ffff27fe3eb in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#35 0x00007ffff4b648d2 in QgsApplication::notify (this=0x7fffffffdb30, receiver=0x7fffffffbee0, 
    event=0x7fffffffb330) at /home/sam/pacchetti_gis/Quantum-GIS/src/core/qgsapplication.cpp:222
#36 0x00007ffff344fbde in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#37 0x00007ffff27fa54b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#38 0x00007ffff2874fbc in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#39 0x00007ffff2873e81 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#40 0x00007ffff289acf2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#41 0x00007fffef4be205 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#42 0x00007fffef4be538 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#43 0x00007fffef4be5f4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#44 0x00007ffff347e2e6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#45 0x00007ffff289a96e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#46 0x00007ffff344e92f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#47 0x00007ffff344ebb8 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#48 0x00007ffff2c31745 in QMenu::exec(QPoint const&, QAction*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#49 0x000000000079f9dc in QgsLegend::handleRightClickEvent (this=0x1035060, item=0x57be350, 
    position=...) at /home/sam/pacchetti_gis/Quantum-GIS/src/app/legend/qgslegend.cpp:720
#50 0x000000000079ceeb in QgsLegend::mousePressEvent (this=0x1035060, e=0x7fffffffce70)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/legend/qgslegend.cpp:344
#51 0x00007ffff2849373 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#52 0x00007ffff2bf4076 in QFrame::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#53 0x00007ffff2d015a3 in QAbstractItemView::viewportEvent(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#54 0x00007ffff2d44d11 in QTreeView::viewportEvent(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#55 0x00007ffff344fd46 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#56 0x00007ffff27f96dc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#57 0x00007ffff27fe3eb in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#58 0x00007ffff4b648d2 in QgsApplication::notify (this=0x7fffffffdb30, receiver=0x10387b0, event=
    0x7fffffffce70) at /home/sam/pacchetti_gis/Quantum-GIS/src/core/qgsapplication.cpp:222
#59 0x00007ffff344fbde in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#60 0x00007ffff27fa54b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#61 0x00007ffff28750f4 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#62 0x00007ffff2873e81 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#63 0x00007ffff289acf2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#64 0x00007fffef4be205 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#65 0x00007fffef4be538 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#66 0x00007fffef4be5f4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#67 0x00007ffff347e2e6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#68 0x00007ffff289a96e in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#69 0x00007ffff344e92f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#70 0x00007ffff344ebb8 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#71 0x00007ffff3453d78 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#72 0x0000000000550363 in main (argc=1, argv=0x7fffffffe3d8)
    at /home/sam/pacchetti_gis/Quantum-GIS/src/app/main.cpp:798
(gdb) 

Updated by Giovanni Manghi about 2 years ago

  • Affected version changed from 1.8.0 to master

Still true on latest master.

Updated by Thomas Arnold about 2 years ago

More a workaround. But it works under windows.

Thomas

Updated by Giovanni Manghi about 2 years ago

  • Patch supplied changed from No to Yes

Updated by Giovanni Manghi almost 2 years ago

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

does not happen anymore in master. Please reopen of necessary.

Also available in: Atom PDF