Bug report #10622

QGIS master crash with MySQL layer. While QGIS 2.2 on same machine seems ok

Added by Richard Duivenvoorde almost 10 years ago. Updated over 9 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Martin Dobias
Category:Vectors
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:up/downstream
Crashes QGIS or corrupts data:No Copied to github as #:19025

Description

After a msg to the list about not showing mysql layer ok on ubuntu:
http://lists.osgeo.org/pipermail/qgis-user/2014-June/028006.html

I downloaded given file

http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip

created a test db and loaded the shapefile with

ogr2ogr -f MySQL MySQL:test,host=localhost,user=test,password=test ne_10m_admin_0_countries.shp -update -overwrite -lco ENGINE=MyISAM

Creating a MySQL connection to this db via (add Vector/Database), and tried to load. QGIS crashes, apparently on a mapcanvas.paint part.

Then I tried QGIS 2.2 (same machine Debian Testing, both build by myself), and that was loading fine.

Part of the crash dump here:

src/providers/ogr/qgsogrprovider.cpp: 2227: (crs) Entering.
src/core/qgscoordinatereferencesystem.cpp: 201: (setupESRIWktFix) set GDAL_FIX_ESRI_WKT : GEOGCS
src/providers/ogr/qgsogrprovider.cpp: 2260: (crs) +proj=longlat +datum=WGS84 +no_defs 
src/core/qgscoordinatereferencesystem.cpp: 441: (createFromWkt) wkt: GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_84",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
src/core/qgscoordinatereferencesystem.cpp: 462: (createFromWkt) authid recognized as EPSG:4326
src/core/qgsdatasourceuri.cpp: 243: (QgsDataSourceURI) invalid connection option "MySQL:test,host" ignored
src/core/qgsmaplayer.cpp: 911: (loadNamedStyle) uri = MySQL:test,host=localhost,user=test,password=test myURI = MySQL:test,host=localhost,user=test,password=test
src/core/qgsmaplayer.cpp: 933: (loadNamedStyle) project fileName: /home/richard/dev/qgis/git/qgis/build
src/core/qgsmaplayer.cpp: 867: (loadNamedStyleFromDb) db = /home/richard/.qgis2//qgis.qmldb uri = MySQL:test,host=localhost,user=test,password=test
src/core/qgsmaplayer.cpp: 877: (loadNamedStyleFromDb) Trying to load style for "MySQL:test,host=localhost,user=test,password=test" from "/home/richard/.qgis2//qgis.qmldb" 
src/core/qgsmaplayer.cpp: 867: (loadNamedStyleFromDb) db = /home/richard/apps/qgis/master/debug/share/qgis/resources/qgis.qmldb uri = MySQL:test,host=localhost,user=test,password=test
src/core/qgsmaplayer.cpp: 877: (loadNamedStyleFromDb) Trying to load style for "MySQL:test,host=localhost,user=test,password=test" from "/home/richard/apps/qgis/master/debug/share/qgis/resources/qgis.qmldb" 
src/providers/ogr/qgsogrprovider.cpp: 595: (subLayers) Entered.
src/providers/ogr/qgsogrprovider.cpp: 620: (subLayers) id = 0 name = ne_10m_admin_0_countries layerGeomType = 3
src/app/qgisapp.cpp: 2708: (addVectorLayers) got valid layer with 1 sublayers
src/providers/ogr/qgsogrprovider.cpp: 595: (subLayers) Entered.
src/core/qgsmaplayer.cpp: 100: (setLayerName) new original name: 'ne_10m_admin_0_countries'
src/core/qgsmaplayer.cpp: 102: (setLayerName) new display name: 'ne_10m_admin_0_countries'
src/gui/qgsmapcanvas.cpp: 612: (refresh) CANVAS refresh scheduling
src/gui/qgsmapcanvas.cpp: 393: (setLayerSet) Layers changed to: MySQL_test_host_localhost_user_test_password_test20140618141735721
src/gui/qgsmapcanvas.cpp: 427: (setLayerSet) Layers have changed, refreshing
src/core/qgsmaprenderer.cpp: 984: (setLayerSet) Entering: MySQL_test_host_localhost_user_test_password_test20140618141735721
src/core/qgsmaprenderer.cpp: 909: (updateFullExtent) called.
src/core/qgsmaprenderer.cpp: 919: (updateFullExtent) Layer count: 1
src/core/qgsmaprenderer.cpp: 929: (updateFullExtent) Updating extent using ne_10m_admin_0_countries
src/providers/ogr/qgsogrprovider.cpp: 862: (extent) Starting get extent
src/providers/ogr/qgsogrprovider.cpp: 900: (extent) Finished get extent
src/core/qgsvectorlayer.cpp: 829: (extent) Extent of layer: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmaprenderer.cpp: 930: (updateFullExtent) Input extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmaprenderer.cpp: 784: (layerExtentToOutputExtent) proj extent = -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmaprenderer.cpp: 942: (updateFullExtent) Output extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmaprenderer.cpp: 973: (updateFullExtent) Full extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/gui/qgsmapcanvas.cpp: 606: (refresh) CANVAS refresh already scheduled
src/core/qgsmapsettings.cpp: 424: (fullExtent) called.
src/core/qgsmapsettings.cpp: 435: (fullExtent) Layer count: 1
src/core/qgsmapsettings.cpp: 445: (fullExtent) Updating extent using ne_10m_admin_0_countries
src/core/qgsmapsettings.cpp: 446: (fullExtent) Input extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmapsettings.cpp: 305: (layerExtentToOutputExtent) proj extent = -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmapsettings.cpp: 458: (fullExtent) Output extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmapsettings.cpp: 489: (fullExtent) Full extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmapsettings.cpp: 424: (fullExtent) called.
src/core/qgsmapsettings.cpp: 435: (fullExtent) Layer count: 1
src/core/qgsmapsettings.cpp: 445: (fullExtent) Updating extent using ne_10m_admin_0_countries
src/core/qgsmapsettings.cpp: 446: (fullExtent) Input extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmapsettings.cpp: 305: (layerExtentToOutputExtent) proj extent = -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmapsettings.cpp: 458: (fullExtent) Output extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsmapsettings.cpp: 489: (fullExtent) Full extent: -179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181
src/core/qgsscalecalculator.cpp: 131: (calculateGeographicDistance) Distance across map extent (m): 4.03241e+07
src/core/qgsscalecalculator.cpp: 88: (calculate) scale = 3.37182e+08 conversionFactor = 39.3701
src/core/qgsmapsettings.cpp: 147: (updateDerived) Map units per pixel (x,y) : 0.83628318584070827, 0.22233634839713431
src/core/qgsmapsettings.cpp: 148: (updateDerived) Pixmap dimensions (x,y) : 452, 820
src/core/qgsmapsettings.cpp: 149: (updateDerived) Extent dimensions (x,y) : 378.00000000000011369, 182.31580568565013323
src/core/qgsmapsettings.cpp: 150: (updateDerived) -188.9999999999998863,-94.3408525163250005 : 189.0000000000002274,87.9749531693251328
src/core/qgsmapsettings.cpp: 151: (updateDerived) Adjusted map units per pixel (x,y) : 0.83628318584070827, 0.83628318584070827
src/core/qgsmapsettings.cpp: 152: (updateDerived) Recalced pixmap dimensions (x,y) : 452, 820
src/core/qgsmapsettings.cpp: 153: (updateDerived) Scale (assuming meters as map units) = 1:337181607.74003785848617554
src/core/qgsmaprenderer.cpp: 195: (adjustExtentToSize) Map units per pixel (x,y) : 0.83628318584070827, 0.22233634839713431
src/core/qgsmaprenderer.cpp: 196: (adjustExtentToSize) Pixmap dimensions (x,y) : 452, 820
src/core/qgsmaprenderer.cpp: 197: (adjustExtentToSize) Extent dimensions (x,y) : 378.00000000000011369, 182.31580568565013323
src/core/qgsmaprenderer.cpp: 198: (adjustExtentToSize) -188.9999999999998863,-94.3408525163250005 : 189.0000000000002274,87.9749531693251328
src/core/qgsmaprenderer.cpp: 206: (adjustExtentToSize) Adjusted map units per pixel (x,y) : 0.83628318584070827, 0.83628318584070827
src/core/qgsmaprenderer.cpp: 208: (adjustExtentToSize) Recalced pixmap dimensions (x,y) : 452, 820
src/core/qgsscalecalculator.cpp: 131: (calculateGeographicDistance) Distance across map extent (m): 4.03241e+07
src/core/qgsscalecalculator.cpp: 88: (calculate) scale = 3.37182e+08 conversionFactor = 39.3701
src/core/qgsmaprenderer.cpp: 213: (adjustExtentToSize) Scale (assuming meters as map units) = 1:337181607.74003785848617554
src/gui/qgsmapcanvas.cpp: 606: (refresh) CANVAS refresh already scheduled
src/gui/qgsmapcanvas.cpp: 622: (refreshMap) CANVAS refresh!
src/core/qgsmaprendererjob.cpp: 573: (prepareJobs) Rendering at layer item MySQL_test_host_localhost_user_test_password_test20140618141735721
src/core/qgsmaprendererjob.cpp: 590: (prepareJobs) layer ne_10m_admin_0_countries:  minscale:0  maxscale:1e+08  scaledepvis:0  extent:-179.9999999999998863,-90.0000000000000000 : 180.0000000000001990,83.6341006530001181  blendmode:0
src/core/qgsvectorlayerrenderer.cpp: 85: (QgsVectorLayerRenderer) rendering v2:
  SINGLE: FILL SYMBOL (1 layers) color 135,71,174,255
src/core/qgsmaprendererjob.cpp: 768: (start) QThreadPool max thread count is 4
src/core/qgsmaprendererjob.cpp: 914: (renderLayerStatic) job 7ad8390 start
QGIS died on signal 11src/gui/qgsmapcanvasmap.cpp: 45: (paint) map paint DIFFERENT SIZE: img 452,820  item 2,4

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[New LWP 11869]
[New LWP 11868]
[New LWP 11867]
[New LWP 11866]
[New LWP 11846]
[New LWP 11845]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fffcabfe000
0x00007ff46d0b3d5d in poll () at ../sysdeps/unix/syscall-template.S:81
81    ../sysdeps/unix/syscall-template.S: No such file or directory.
[Current thread is 1 (Thread 0x7ff474d6f7c0 (LWP 11842))]
#0  0x00007ff46d0b3d5d in poll () at ../sysdeps/unix/syscall-template.S:81
No locals.
#1  0x00007ff46b903fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#2  0x00007ff46b9040ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x00007ff4701bc655 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#4  0x00007ff46f5cd7c6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
No symbol table info available.
#5  0x00007ff47018dfef in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#6  0x00007ff47018e2e5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#7  0x00007ff470193ab9 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
No symbol table info available.
#8  0x000000000055aafb in main (argc=1, argv=0x7fffcaade028) at /home/richard/dev/qgis/git/qgis/src/app/main.cpp:1017
        qgistor = <incomplete type>
        mySnapshotHeight = 600
        args = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 7816}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x1161f50}, d = 0x1161f50}}, <No data fields>}
        myApp = {<QApplication> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7ff46ffd3440 <QApplication::staticMetaObject>, stringdata = 0x7ff471ad5800 <qt_meta_stringdata_QgsApplication> "QgsApplication", data = 0x7ff471ad5780 <qt_meta_data_QgsApplication>, extradata = 0x7ff471de7f50 <QgsApplication::staticMetaObjectExtraData>}}, static staticMetaObjectExtraData = {objects = 0x0, static_metacall = 0x7ff471a52758 <QgsApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>}, static QGIS_ORGANIZATION_NAME = 0x7ff471a738d6 "QGIS", static QGIS_ORGANIZATION_DOMAIN = 0x7ff471a738db "qgis.org", static QGIS_APPLICATION_NAME = 0x7ff471a738e4 "QGIS2", static mFileOpenEventReceiver20300 = 0x13a7ef0, static mFileOpenEventList20300 = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 7816}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0xe9f9a0 <QListData::shared_null>}, d = 0xe9f9a0 <QListData::shared_null>}}, <No data fields>}, static mPrefixPath20300 = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 12741}, alloc = 0, size = 0, data = 0xea1b9a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 5492}, alloc = 0, size = 0, data = 0x7ff4704f591a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1340210, static codecForCStrings = 0x0}, static mPluginPath20300 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1342160, static codecForCStrings = 0x0}, static mPkgDataPath20300 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1341e90, static codecForCStrings = 0x0}, static mLibraryPath20300 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1342410, static codecForCStrings = 0x0}, static mLibexecPath20300 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x13424a0, static codecForCStrings = 0x0}, static mThemeName20300 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x1424940, static codecForCStrings = 0x0}, static mDefaultSvgPaths20300 = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 7816}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x1341f40}, d = 0x1341f40}}, <No data fields>}, static mSystemEnvVars20300 = {{d = 0x0, e = 0x0}}, static mConfigPath20300 = {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 12741}, alloc = 0, size = 0, data = 0xea1b9a <QString::shared_null+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 5492}, alloc = 0, size = 0, data = 0x7ff4704f591a <QString::shared_empty+26>, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x1340f00, static codecForCStrings = 0x0}, static mRunningFromBuildDir20300 = false, static mBuildSourcePath20300 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0x0, static codecForCStrings = 0x0}, static mBuildOutputPath20300 = {static null = <same as static member of an already seen type>, static shared_null = <same as static member of an already seen type>, static shared_empty = <same as static member of an already seen type>, d = 0xea1b80 <QString::shared_null>, static codecForCStrings = 0x0}, static mGdalSkipList20300 = {<QList<QString>> = {{p = {static shared_null = {ref = {_q_value = 7816}, alloc = 0, begin = 0, end = 0, sharable = 1, array = {0x0}}, d = 0x0}, d = 0x0}}, <No data fields>}, static mMaxThreads20300 = 0}
        myLocaleOverrideFlag = false
        __FUNCTION__ = "main" 

History

#1 Updated by Saber Razmjooei almost 10 years ago

  • Assignee set to Martin Dobias

Further info from terminal:

QGIS died on signal 11ptrace: Operation not permitted.
No thread selected
No stack.
gdb returned 0
Aborted (core dumped)

Seems to be related to the MTR.

#2 Updated by Martin Dobias almost 10 years ago

  • Affected QGIS version changed from 2.2.0 to master

This is related to multi-threaded rendering, but in fact it is a bug in OGR MySQL driver: http://trac.osgeo.org/gdal/ticket/5528

I have prepared a patch for OGR.

Not sure if we can do anything in QGIS with it. The only way to avoid the problem would be a special configuration option that would force the rendering to be done in main thread - for cases like this.

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

Martin Dobias wrote:

This is related to multi-threaded rendering, but in fact it is a bug in OGR MySQL driver: http://trac.osgeo.org/gdal/ticket/5528

I have prepared a patch for OGR.

Not sure if we can do anything in QGIS with it. The only way to avoid the problem would be a special configuration option that would force the rendering to be done in main thread - for cases like this.

BTW http://download.osgeo.org/osgeo4w/x86_64/release/gdal/gdal-1.11.0-1-src.tar.bz2 has a similar patch (just made to build with MySQL 6; it still passes on the args to mysql_library_init).

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

  • Target version changed from Version 2.4 to Future Release - High Priority

#5 Updated by Martin Dobias over 9 years ago

  • Resolution set to up/downstream
  • Status changed from Open to Closed

Fixed in GDAL 1.11.1 / trunk (will be 2.0)

Also available in: Atom PDF