Bug report #18981

Save QLR crashes QGIS 3

Added by Jakob Lanstorp over 2 years ago. Updated over 2 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:Unknown
Affected QGIS version:3.0.2 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:26812

Description

When saving a QLR file having many grouped WMS in TOC 3.0.2-Girona crashes

Attached image of TOC where the parent group called qgis_plugin is saved as a QLR. QLR file also attached.

Crash report:
h2. User Feedback
h2. Report Details
Crash ID: e1167528848bf019c0d2ca12d580a5988469a23b

Stack Trace

QgsMapLayer::writeLayerXml :
QgsLayerDefinition::exportLayerDefinition :
QgsLayerDefinition::exportLayerDefinition :
QgisApp::saveAsLayerDefinition :
QgisApp::qt_static_metacall :
QMetaObject::activate :
QAction::activate :
QMenu::actionGeometry :
QMenu::actionGeometry :
QMenu::mouseReleaseEvent :
QWidget::event :
QMenu::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QMenu::exec :
QgsLayerTreeView::contextMenuEvent :
QWidget::event :
QFrame::event :
QAbstractItemView::viewportEvent :
QCoreApplicationPrivate::sendThroughObjectEventFilters :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify :
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
CallWindowProcW :
DispatchMessageW :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.0.2-Girona
QGIS code revision: 307d082e3d
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.4
Running against GDAL: 2.2.4

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.16299

Udklip.PNG - TOC (25.1 KB) Jakob Lanstorp, 2018-05-18 11:24 AM

kortforsyning_data.qlr (263 KB) Jakob Lanstorp, 2018-05-18 11:26 AM

Associated revisions

Revision ec909b0a
Added by Alessandro Pasotti over 2 years ago

[bugfix] Crash when exporting (invalid) legend to qlr

Fixes #18981 Save QLR crashes QGIS 3

This patch definitely prevents the crash but I'm not sure if
we should also introduce the same check in QgsLayerTree::isLayer
or even in QgsLayerTreeGroup::findLayers() or also when importing
a qlr that might lead to invalid layer (like in this
bug report).

Revision 51ae8e9e
Added by Alessandro Pasotti over 2 years ago

Merge pull request #7195 from elpaso/bugfix-18981-export-qlr-crash-2

[bugfix] Crash when exporting (invalid) legend to qlr
Fixes #18981

History

#1 Updated by Alessandro Pasotti over 2 years ago

  • Status changed from Open to Feedback
  • Assignee set to Alessandro Pasotti

I'm not able to reproduce this issue, can you please attach a minimal project and step-by-step procedure to reproduce it?

#2 Updated by Jakob Lanstorp over 2 years ago

Download the attached qlr file called kortforsyning_data.qlr (content is only WMS layers). Open it in QGIS and try to save it as a new QLR file.

#3 Updated by Alessandro Pasotti over 2 years ago

  • Priority changed from Normal to High
  • Status changed from Feedback to In Progress

Confirmed, working on it

#4 Updated by Alessandro Pasotti over 2 years ago

  • Pull Request or Patch supplied changed from No to Yes

#5 Updated by Alessandro Pasotti over 2 years ago

for the record: the invalid layer was DTK/D850 but still QGIS does not need to crash.

#6 Updated by Anonymous over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

#7 Updated by Alessandro Pasotti over 2 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF