Bug report #12930

Crash when deleting a column from attribute table

Added by Frank Sokolic almost 9 years ago. Updated almost 9 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Attribute table
Affected QGIS version:master Regression?:No
Operating System:Ubuntu Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:21012

Description

QGIS crashes when deleting a column from a shapefile attribute table using the Delete column (Crtl L) tool in the attribute table. Deleting columns using the Table Manager works ok.

Here is a dump of the messages generated when the crash occurred:

(qgis.bin:7464): Gtk-CRITICAL **: IA__gtk_progress_configure: assertion 'value >= min && value <= max' failed
(qgis.bin:7464): Gtk-CRITICAL **: IA__gtk_progress_configure: assertion 'value >= min && value <= max' failed
(qgis.bin:7464): Gtk-CRITICAL **: IA__gtk_progress_configure: assertion 'value >= min && value <= max' failed
Fatal: ASSERT failure in QVector<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qvector.h, line 355
Stacktrace (piped through c++filt):
/usr/bin/qgis.bin[0x4c7c9d]
/usr/bin/qgis.bin[0x4c7f8e]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qt_message_output(QtMsgType, char const*)+0x31)[0x7f576808b991]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x71df9)[0x7f576808bdf9]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qFatal(char const*, ...)+0xa1)[0x7f576808c6e1]
/usr/lib/libqgis_core.so.2.9.0(+0x3007a3)[0x7f5769a1f7a3]
/usr/lib/libqgis_core.so.2.9.0(QgsFields::operator[](int) const+0x30)[0x7f5769a1e14a]
/usr/lib/libqgis_gui.so.2.9.0(QgsAttributeTableModel::data(QModelIndex const&, int) const+0x1cf)[0x7f5769176a21]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QSortFilterProxyModel::data(QModelIndex const&, int) const+0x98)[0x7f5767a9ebd8]
/usr/lib/libqgis_gui.so.2.9.0(QgsAttributeTableDelegate::paint(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const+0xd8)[0x7f576916f29e]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x725af4)[0x7f5767a45af4]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QTableView::paintEvent(QPaintEvent*)+0x8ca)[0x7f5767a4f86a]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QWidget::event(QEvent*)+0x298)[0x7f576753bdc8]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QFrame::event(QEvent*)+0x1e)[0x7f576790264e]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAbstractItemView::viewportEvent(QEvent*)+0x1e3)[0x7f5767a201a3]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)+0x86)[0x7f57681a1336]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0x6c)[0x7f57674e899c]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::notify(QObject*, QEvent*)+0x2b8)[0x7f57674ef4d8]
/usr/lib/libqgis_core.so.2.9.0(QgsApplication::notify(QObject*, QEvent*)+0x9b)[0x7f5769988501]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*, QEvent*)+0x8d)[0x7f57681a11cd]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*)+0x5fd)[0x7f576753649d]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x3ec0ba)[0x7f576770c0ba]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QWidgetPrivate::syncBackingStore()+0xa0)[0x7f576752abc0]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QWidget::event(QEvent*)+0x368)[0x7f576753be98]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0x8c)[0x7f57674e89bc]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::notify(QObject*, QEvent*)+0x2b8)[0x7f57674ef4d8]
/usr/lib/libqgis_core.so.2.9.0(QgsApplication::notify(QObject*, QEvent*)+0x9b)[0x7f5769988501]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*, QEvent*)+0x8d)[0x7f57681a11cd]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)+0x231)[0x7f57681a4a71]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x1b66ee)[0x7f57681d06ee]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x24d)[0x7f5763245c3d]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49f20)[0x7f5763245f20]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7f5763245fcc]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x7e)[0x7f57681d085e]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x270c66)[0x7f5767590c66]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x41)[0x7f57681a4f51]
/usr/lib/libqgis_gui.so.2.9.0(QgsDualView::progress(int, bool&)+0x217)[0x7f576918160d]
/usr/lib/libqgis_gui.so.2.9.0(+0x42abe6)[0x7f5769330be6]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QMetaObject::activate(QObject*, QMetaObject const*, int, void**)+0x32c)[0x7f57681b61ec]
/usr/lib/libqgis_gui.so.2.9.0(QgsAttributeTableModel::progress(int, bool&)+0x69)[0x7f576933040d]
/usr/lib/libqgis_gui.so.2.9.0(QgsAttributeTableModel::loadLayer()+0x1a2)[0x7f5769175df0]
/usr/lib/libqgis_gui.so.2.9.0(+0x42a10a)[0x7f576933010a]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QMetaObject::activate(QObject*, QMetaObject const*, int, void**)+0x32c)[0x7f57681b61ec]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayerCache::invalidated()+0x29)[0x7f5769d46ba5]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayerCache::invalidate()+0x28)[0x7f5769b80e36]
/usr/lib/libqgis_core.so.2.9.0(+0x6278a6)[0x7f5769d468a6]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QMetaObject::activate(QObject*, QMetaObject const*, int, void**)+0x32c)[0x7f57681b61ec]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayer::updatedFields()+0x29)[0x7f5769d44cf5]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayer::updateFields()+0x16e)[0x7f5769b70cf4]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayerEditBuffer::updateLayerFields()+0x1c)[0x7f5769b857fa]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayerUndoCommandDeleteAttribute::redo()+0x7a)[0x7f5769b9e7cc]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QUndoStack::push(QUndoCommand*)+0x33)[0x7f5767b68183]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayerEditBuffer::deleteAttribute(int)+0x177)[0x7f5769b832a5]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayer::deleteAttribute(int)+0xd5)[0x7f5769b6d6f3]
/usr/lib/libqgis_core.so.2.9.0(QgsVectorLayer::deleteAttributes(QList<int>)+0xf2)[0x7f5769b6d7e8]
/usr/bin/qgis.bin(QgsAttributeTableDialog::on_mRemoveAttribute_clicked()+0x14b)[0x56fac1]
/usr/bin/qgis.bin[0x8bfb1d]
/usr/bin/qgis.bin(QgsAttributeTableDialog::qt_metacall(QMetaObject::Call, int, void**)+0x5c)[0x8bffce]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QMetaObject::activate(QObject*, QMetaObject const*, int, void**)+0x6cb)[0x7f57681b658b]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAbstractButton::clicked(bool)+0x42)[0x7f5767b81332]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x59e573)[0x7f57678be573]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x59f924)[0x7f57678bf924]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAbstractButton::mouseReleaseEvent(QMouseEvent*)+0x74)[0x7f57678bfa34]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QToolButton::mouseReleaseEvent(QMouseEvent*)+0xa)[0x7f5767981b1a]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QWidget::event(QEvent*)+0x298)[0x7f576753bdc8]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0x8c)[0x7f57674e89bc]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::notify(QObject*, QEvent*)+0x41f)[0x7f57674ef63f]
/usr/lib/libqgis_core.so.2.9.0(QgsApplication::notify(QObject*, QEvent*)+0x9b)[0x7f5769988501]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*, QEvent*)+0x8d)[0x7f57681a11cd]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)+0x15f)[0x7f57674eec9f]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x2489a2)[0x7f57675689a2]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::x11ProcessEvent(_XEvent*)+0x164c)[0x7f576756824c]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x270ba2)[0x7f5767590ba2]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x24d)[0x7f5763245c3d]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49f20)[0x7f5763245f20]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7f5763245fcc]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x7e)[0x7f57681d085e]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x270c66)[0x7f5767590c66]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x41)[0x7f576819fd21]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)+0x1a5)[0x7f57681a0085]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::exec()+0x99)[0x7f57681a5b09]
/usr/bin/qgis.bin[0x4cb122]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f5765465a40]
/usr/bin/qgis.bin(_start+0x29)[0x4c76f9]
Aborted (core dumped)

sample.zip (2.52 MB) Frank Sokolic, 2015-06-18 01:17 AM

Associated revisions

Revision fccd8e58
Added by Matthias Kuhn almost 9 years ago

Disable view updates while reloading attribute table

Fix #12930

Revision 6215f773
Added by Martin Dobias almost 9 years ago

Fix crash when deleting a field in attribute table (fixes #12930)

Also fixes:
- multiple reloads of table (due to additional connections to cache invalidation)
- crash in attribute form (on redo of deleted field when it was not the last)
- crash in editor widget wrapper (during table reload)

History

#1 Updated by Giovanni Manghi almost 9 years ago

  • Status changed from Open to Feedback
  • Target version changed from Version 2.10 to Future Release - High Priority

I cannot confirm on ubuntu 14.04 and qgis master installed from the nightly builds repo.

#2 Updated by Matthias Kuhn almost 9 years ago

  • Status changed from Feedback to Closed

#3 Updated by Matthias Kuhn almost 9 years ago

I could reproduce it once but not reliably.
It seems to be caused by a race-condition and repeated calling of processEvents() for the progress indicator.
Hopefully this latest commit fixes it.

#4 Updated by Frank Sokolic almost 9 years ago

  • Status changed from Closed to Reopened

Unfortunately I'm still getting the crash.

Could it be a memory problem? When deleting a column from a table with > 20000 records QGIS crashes immediately. When deleting from shapefiles with a small amount of records then QGIS doesn't crash.

#5 Updated by Giovanni Manghi almost 9 years ago

Frank Sokolic wrote:

Unfortunately I'm still getting the crash.

Could it be a memory problem? When deleting a column from a table with > 20000 records QGIS crashes immediately. When deleting from shapefiles with a small amount of records then QGIS doesn't crash.

please attach sample data.

#6 Updated by Frank Sokolic almost 9 years ago

Here's the shapefile that causes QGIS to crash every time I try delete a column.

#7 Updated by Giovanni Manghi almost 9 years ago

  • Priority changed from High to Severe/Regression

apparently it happens only when deleting the column from within the table of attributes, and it happens only on Linux (ubuntu here too) as Windows is ok. And it was ok on 2.8.2

#8 Updated by Martin Dobias almost 9 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF