Bug report #4690

Crash when adding field to a shape file's attribute table

Added by David Kneis almost 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:High
Assignee:-
Category:-
Affected QGIS version:1.7.3 Regression?:No
Operating System:Ubuntu 10.04 LTS Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:14576

Description

When adding a new field to a shape file's attribute table, QGIS 1.7.3-Wroclaw (running on Ubuntu 10.04 LTS) crashes due to an out-of-range condition. I tried this on several existing and newly created shape files (feature type: lines). It does not matter whether the new field is added manually or automatically (by trying to store calculation results in a new field). I was unable to produce a backtrace because of missing debugging symbols. The shell output including the essential error message follows:

[email protected]:/home$ qgis
Python support ENABLED :-)
Loaded : Plugin Installer (package: plugin_installer)
Fatal: ASSERT failure in QList<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qlist.h, line 443
Abgebrochen

bug_4690_additional.pdf (140 KB) David Kneis, 2011-12-22 06:52 AM

backtrace.txt Magnifier (5.16 KB) David Kneis, 2011-12-23 06:08 AM

Associated revisions

History

#1 Updated by Alexander Bruy almost 10 years ago

Not reproducible here under Linux with master and latest 1.7

#2 Updated by Paolo Cavallini almost 10 years ago

  • Status changed from Open to Feedback

Please check if it's not a previous libqgis hanging around, or a plugin (remove them all and retry).

#3 Updated by David Kneis almost 10 years ago

Try 1: I installed version 1.9.90-Alpha. All extensions disabled. The problem still exists.
Try 2: I removed older versions of libqgis. Then re-installed version 1.7.3. The problem still exists.

However, I detected a second 'strange' behavior which might be connected to the reported out-of-range crash: When I open the shape file's attribute table, no data are initially displayed. I need to click on the header of a column first to make the table's contents visible. Moreover, the message in the top panel of the window reads like "Attributes table - <Layer name> :: 0 / 0 objects selected" (translated from German). The second zero in "0 / 0" might actually point to an index problem since the number of features (and records in the attributes table) is > 0. I appended a screenshot (as a PDF) to illustrate this.

#4 Updated by Jürgen Fischer almost 10 years ago

  • Affected QGIS version set to 1.7.3

#5 Updated by Jürgen Fischer almost 10 years ago

  • Crashes QGIS or corrupts data set to Yes

#6 Updated by David Kneis almost 10 years ago

I was now able to create a backtrace. The gdb output is in the attached text file.

#7 Updated by Giovanni Manghi almost 10 years ago

The very same error message show in ticket #3963

Fatal: ASSERT failure in QList<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qlist.h, line 464

#8 Updated by David Kneis almost 10 years ago

I think I identified the condition leading to the described crash:

The crash does NOT occur if the default behavior for attribute tables is set to "Show all features" under Settings/Options/General/Attribute table behavior.

However, the crash does occur if the default behavior is set to "Show selected features".

#9 Updated by Jürgen Fischer almost 10 years ago

David Kneis wrote:

However, I detected a second 'strange' behavior which might be connected to the reported out-of-range crash: When I open the shape file's attribute table, no data are initially displayed. I need to click on the header of a column first to make the table's contents visible.

That is the bug. Sorting the empty table shouldn't change a thing.

#10 Updated by Jürgen Fischer almost 10 years ago

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

Also available in: Atom PDF