Bug report #16613

QGIS crashes on add layer

Added by Dmitry Baryshnikov over 4 years ago. Updated over 4 years ago.

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

Description

When opening PostGIS layer QGIS crashes.

Here it is part of the dump.

src/app/qgisapp.cpp: 9843: (addVectorLayer) [1ms] got valid layer with 0 sublayers
Fatal: ASSERT failure in QList<T>::at: "index out of range", file /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h, line 537
QGIS died on signal -1[New LWP 10697]

In sources I see using same named variables: QStringList sublayers

The first variable declared here: source:src/app/qgisapp.cpp#L9840
And second here: source:src/app/qgisapp.cpp#L9860

When get 0 element from list, first variable is using, not second, as expected: source:src/app/qgisapp.cpp#L9863

The solutions are:

  1. Rename second variable
  2. Remove second variable declaration

Related issues

Duplicates QGIS Application - Bug report #16593: Segmentation fault when importing CSV file with coordinates Closed 2017-05-22

History

#1 Updated by Giovanni Manghi over 4 years ago

  • Status changed from Open to Feedback

is this when you add the layer from the qgis browser?

#2 Updated by Giovanni Manghi over 4 years ago

  • Easy fix? changed from Yes to No
  • Priority changed from Normal to High
  • Crashes QGIS or corrupts data changed from No to Yes

#3 Updated by Dmitry Baryshnikov over 4 years ago

Giovanni Manghi wrote:

is this when you add the layer from the qgis browser?

Yes. Drag'n'drop to map canvas from QGIS Browser produces crash too.

#4 Updated by Giovanni Manghi over 4 years ago

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

been already fixed, wait a new build downgrade or just use the "add postgis layer" dialog meanwhile.

#5 Updated by Jürgen Fischer over 4 years ago

  • Duplicates Bug report #16593: Segmentation fault when importing CSV file with coordinates added

#6 Updated by Jürgen Fischer over 4 years ago

  • Description updated (diff)

Also available in: Atom PDF