Bug report #19625

OGR PBF dataset crashes QGIS

Added by Mathieu Pellerin - nIRV over 5 years ago. Updated over 5 years ago.

Category:Data Provider/OGR
Affected QGIS version:3.3(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 #:27452


Steps to reproduce
  1. Launch QGIS, and make sure the style dock panel is open
  2. In a new/blank project, and add the "lines" and "multipolygons" layers from this PBF dataset (https://www.dropbox.com/s/2atn0n2as4eyyc8/f_small.osm.pbf?dl=0)
  3. Zoom onto the canvas a bit, and while the layers are rendering, switch the focused layer to the one that isn't selected (in the layers panel)
  4. boom QGIS dies

gdb trace

Thread 1 "qgis" received signal SIGSEGV, Segmentation fault.
0x00007ffff5fcb52a in QgsAbstractFeatureSource::~QgsAbstractFeatureSource (
    this=0x55555d718e10, __in_chrg=<optimized out>)
    at /home/webmaster/dev/cpp/QGIS/src/core/qgsfeaturerequest.cpp:324
325          it->close();
(gdb) where
#0  0x00007ffff5fcb52a in QgsAbstractFeatureSource::~QgsAbstractFeatureSource() (this=0x55555d718e10, __in_chrg=<optimized out>)
    at /home/webmaster/dev/cpp/QGIS/src/core/qgsfeaturerequest.cpp:324
#1  0x00007fffb0e77570 in QgsOgrFeatureSource::~QgsOgrFeatureSource() (this=0x55555d718e10, __in_chrg=<optimized out>)
    at /home/webmaster/dev/cpp/QGIS/src/providers/ogr/qgsogrfeatureiterator.cpp:490
#2  0x00007fffb0e775a4 in QgsOgrFeatureSource::~QgsOgrFeatureSource() (this=0x55555d718e10, __in_chrg=<optimized out>)
    at /home/webmaster/dev/cpp/QGIS/src/providers/ogr/qgsogrfeatureiterator.cpp:493
#3  0x00007ffff627636a in QgsVectorLayerFeatureSource::~QgsVectorLayerFeatureSource() (this=0x55555d4abfe0, __in_chrg=<optimized out>)
    at /home/webmaster/dev/cpp/QGIS/src/core/qgsvectorlayerfeatureiterator.cpp:92
#4  0x00007ffff6276440 in QgsVectorLayerFeatureSource::~QgsVectorLayerFeatureSource() (this=0x55555d4abfe0, __in_chrg=<optimized out>)
    at /home/webmaster/dev/cpp/QGIS/src/core/qgsvectorlayerfeatureiterator.cpp:93
#5  0x00007ffff627bf36 in QgsAbstractFeatureIteratorFromSource<QgsVectorLayerFeatureSource>::~QgsAbstractFeatureIteratorFromSource() (this=0x55555a545980, __in_chrg=<optimized out>)
    at /home/webmaster/dev/cpp/QGIS/src/core/qgsfeatureiterator.h:247

Associated revisions

Revision dd86dfe6
Added by Mathieu Pellerin - nIRV over 5 years ago

[ogr provider] disable connection timeouts (fixes #19625 et cie)


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

If the feature fetching code in QgsSymbolSelectorDialog's constructor is disabled (see https://github.com/qgis/QGIS/blob/master/src/gui/symbology/qgssymbolselectordialog.cpp#L257), the crash doesn't happen.

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

I can narrow the cause of the crash. If I only remove the timeout part of the feature request (https://github.com/qgis/QGIS/blob/master/src/gui/symbology/qgssymbolselectordialog.cpp#L257), the crash disappears.

Nyall, this is a recent change you applied. Any chance we could revert this please (band-aid), or investigate why the timeout on this OGR PBF dataset creates a crasher? :)

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

PR coming, crash (and other regressions caused by the setConnectionTimeout) is due to OGR connections not properly handling timeouts ATM. PR will disable timeouts for OGR datasets.

#4 Updated by Mathieu Pellerin - nIRV over 5 years ago

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

#5 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF