Bug report #12064

crash when creating a layer definition file from a memory layer

Added by Richard Duivenvoorde about 9 years ago. Updated about 9 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Jürgen Fischer
Category:Project Loading/Saving
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:20265

Description

100% reproducable with current master:

- open a new (point) memory layer in QGIS in empty project
- start editing the layer and add 2 points to it (no styling or whatever)
- stop/save editing
- create a layer definition file from it
- open the layer definition file: full crash

also reopening QGIS and only trying to load the qlr file crashes it

adding a qlr file as attachment

ccc.qlr (4.38 KB) Richard Duivenvoorde, 2015-01-27 05:50 AM

Associated revisions

Revision ee50520a
Added by Jürgen Fischer about 9 years ago

fix leak on loading layer definition (also fixes #12064)

History

#1 Updated by Nathan Woodrow about 9 years ago

No crash here on Windows at least.

#2 Updated by Richard Duivenvoorde about 9 years ago

I will try on another machine, but here with me still crashing: see trace below

Note: I'm loading this in an empty project.

src/core/qgscoordinatereferencesystem.cpp: 1158: (readXML) [1ms] Reading Spatial Ref Sys from xml ------------------------!
src/core/qgscoordinatereferencesystem.cpp: 992: (setMapUnits) [11ms] Projection has linear units of metre
src/core/qgscoordinatereferencesystem.cpp: 1201: (readXML) [0ms] Set from auth id
src/core/qgsvectorlayer.cpp: 1266: (readXml) [1ms] Datasource in QgsVectorLayer::readXml: Point?crs=proj4:+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs
src/core/qgsproviderregistry.cpp: 348: (provider) [0ms] Library name is /home/richard/apps/qgis/master/debug/lib/qgis/plugins/libmemoryprovider.so
src/core/qgscoordinatereferencesystem.cpp: 522: (createFromProj4) [0ms] proj4: +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs
src/core/qgscoordinatereferencesystem.cpp: 552: (createFromProj4) [1ms] proj string supplied has no +a argument
src/core/qgscoordinatereferencesystem.cpp: 719: (getRecord) [0ms] running query: select * from tbl_srs where parameters='+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs' order by deprecated
src/core/qgscoordinatereferencesystem.cpp: 740: (getRecord) [6ms] trying system srs.db
src/core/qgscoordinatereferencesystem.cpp: 810: (getRecord) [1ms] retrieved:  select * from tbl_srs where parameters='+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs' order by deprecated
src/core/qgscoordinatereferencesystem.cpp: 673: (createFromProj4) [0ms] proj4string param match search for srsid returned srsid: 2517
src/core/qgscoordinatereferencesystem.cpp: 992: (setMapUnits) [1ms] Projection has linear units of metre
src/core/qgsproviderregistry.cpp: 370: (provider) [0ms] Instantiated the data provider plugin: memory
src/core/qgsvectorlayer.cpp: 1368: (setDataProvider) [0ms] Instantiated the data provider plugin
src/core/qgsvectorlayer.cpp: 1595: (readSymbology) [1ms] calling readXML
src/core/qgslabel.cpp: 731: (readXML) [1ms]  called for layer label properties, got node labelattributes
src/core/qgsmaplayer.cpp: 106: (setLayerName) [0ms] new original name: 'Memory layer'
src/core/qgsmaplayer.cpp: 108: (setLayerName) [0ms] new display name: 'Memory layer'
Fatal: ASSERT: "node->mParent == 0" in file /home/richard/dev/qgis/git/qgis/src/core/layertree/qgslayertreenode.cpp, line 118
Stacktrace (piped through c++filt):
/home/richard/apps/qgis/master/debug/bin/qgis[0x579646]
/home/richard/apps/qgis/master/debug/bin/qgis(myMessageOutput(QtMsgType, char const*)+0x1c3)[0x57990f]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qt_message_output(QtMsgType, char const*)+0x31)[0x7f947efb86a1]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x71b09)[0x7f947efb8b09]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qFatal(char const*, ...)+0xa1)[0x7f947efb93f1]
/home/richard/apps/qgis/master/debug/lib/libqgis_core.so.2.7.0(QgsLayerTreeNode::insertChildrenPrivate(int, QList<QgsLayerTreeNode*>)+0x86)[0x7f94807c4fb8]
/home/richard/apps/qgis/master/debug/lib/libqgis_core.so.2.7.0(QgsLayerTreeGroup::insertChildNodes(int, QList<QgsLayerTreeNode*>)+0x3c)[0x7f94807afa8c]
/home/richard/apps/qgis/master/debug/lib/libqgis_core.so.2.7.0(QgsLayerDefinition::loadLayerDefinition(QDomDocument, QgsLayerTreeGroup*, QString&)+0x57d)[0x7f948088ffc5]
/home/richard/apps/qgis/master/debug/lib/libqgis_core.so.2.7.0(QgsLayerDefinition::loadLayerDefinition(QString const&, QgsLayerTreeGroup*, QString&)+0x19b)[0x7f948088f961]
/home/richard/apps/qgis/master/debug/bin/qgis(QgisApp::openLayerDefinition(QString const&)+0x40)[0x5a3ada]
/home/richard/apps/qgis/master/debug/bin/qgis(QgisApp::addLayerDefinition()+0xe8)[0x59705c]
/home/richard/apps/qgis/master/debug/bin/qgis[0x96218e]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QMetaObject::activate(QObject*, QMetaObject const*, int, void**)+0x32c)[0x7f947f0e1f4c]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAction::triggered(bool)+0x42)[0x7f947e41aaf2]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QAction::activate(QAction::ActionEvent)+0x87)[0x7f947e41c677]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x615ead)[0x7f947e86fead]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x61a869)[0x7f947e874869]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QWidget::event(QEvent*)+0x298)[0x7f947e4744d8]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QMenu::event(QEvent*)+0x6b)[0x7f947e87883b]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0x8c)[0x7f947e42129c]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::notify(QObject*, QEvent*)+0x41f)[0x7f947e427f0f]
/home/richard/apps/qgis/master/debug/lib/libqgis_core.so.2.7.0(QgsApplication::notify(QObject*, QEvent*)+0xb3)[0x7f94807ccca7]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::notifyInternal(QObject*, QEvent*)+0x8d)[0x7f947f0ccf8d]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)+0x15f)[0x7f947e42756f]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x24443a)[0x7f947e49e43a]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(QApplication::x11ProcessEvent(_XEvent*)+0x60c)[0x7f947e49ca9c]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bad2)[0x7f947e4c5ad2]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x24d)[0x7f9479ba7c5d]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49f48)[0x7f9479ba7f48]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7f9479ba7ffc]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x5d)[0x7f947f0fc4ed]
/usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bb96)[0x7f947e4c5b96]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x41)[0x7f947f0cbae1]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)+0x1a5)[0x7f947f0cbe45]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QCoreApplication::exec()+0x99)[0x7f947f0d18b9]
/home/richard/apps/qgis/master/debug/bin/qgis(main+0x315d)[0x57cace]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f947b9e2b45]
/home/richard/apps/qgis/master/debug/bin/qgis[0x5790e9]
/usr/local/bin/qgis: line 6: 30332 Aborted                 /home/richard/apps/qgis/master/debug/bin/qgis "$@" 

#3 Updated by Jürgen Fischer about 9 years ago

  • Status changed from Open to Feedback
  • Category set to Project Loading/Saving

Richard Duivenvoorde wrote:

I will try on another machine, but here with me still crashing: see trace below

Note: I'm loading this in an empty project.

[...]

you're loading a memory layer from a qlr?

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

  • Assignee changed from Nathan Woodrow to Jürgen Fischer

#5 Updated by Jürgen Fischer about 9 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF