Bug report #17673

QGIS crash on close when Spatial Bookmarks panel is showing as a floating window

Added by Steven Mizuno almost 3 years ago. Updated over 2 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:GUI
Affected QGIS version:master Regression?:Yes
Operating System:Windows 8.1, 7 x64 Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:25570

Description

Using master (010cb1567b)

Doesn't crash if the bookmarks panel is docked or isn't showing.

2.18.15 also crashes on close under the same conditions.

crash report:
h2. User Feedback

Report Details

Crash ID: 9ca8f947470220027da8b0cb78fbece8d2987297

Stack Trace

QgsOptions::tr :
QgsOptions::tr :
QHeaderView::sectionSizeFromContents :
QHeaderView::sizeHint :
QTreeView::updateGeometries :
QMetaObject::activate :
QHeaderView::viewportEvent :
QCoreApplicationPrivate::sendThroughObjectEventFilters :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsWkbException::QgsWkbException :
QCoreApplication::notifyInternal2 :
QWidgetPrivate::hideChildren :
QWidgetPrivate::hideChildren :
QWidgetPrivate::hideChildren :
QWidgetPrivate::hideChildren :
QWidgetPrivate::hide_helper :
QWidget::setVisible :
QWidgetPrivate::close_helper :
QWidget::~QWidget :
QgsShadowEffectWidget::initGui :
QgsOptions::tr :
QgsOptions::tr :
QObjectPrivate::deleteChildren :
QWidget::~QWidget :
QgsOptions::tr :
QgsOptions::tr :
QgsOptions::tr :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 2.99.0-Master
QGIS code revision: 010cb1567b
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.3
Running against GDAL: 2.2.3

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

Associated revisions

Revision 63cf7ae6
Added by Alessandro Pasotti almost 3 years ago

[bugfix] Bookmrks fix crash on exit when docked

Order of destruction does matter

Fixes #17673

History

#1 Updated by Richard Duivenvoorde almost 3 years ago

Cannot confirm here, neither master nor 2.18.15 (I'm on Debian).

Can you describe the exact steps on how to reproduce the crash?

#2 Updated by Steven Mizuno almost 3 years ago

  • Operating System set to Windows 8.1, 7 x64

Steps:
1. start QGIS
2. open Spatial Bookmarks
3. if panel is docked, undock it so it is a separate window (the little button or just drag it off the main window)
4. close QGIS (I normally use the close button, but have tried Exit on the Project menu, too)

Perhaps I could have been more specific about using Windows 8.1 and Windows 7, both x64 systems.
I tried OSGeo4W builds as well as my own builds which are based on OSGeo4W libraries, etc.

And I didn't experience the crash if other dockwidgets are floating, specifically GPS Information and Python Console.

#3 Updated by Steven Mizuno almost 3 years ago

After comparing QgsBookmarks code before and after the recent changes, I believe the QgsBookmarks destructor should delete mProxyModel, either directly or through lstBookmarks->model(), rather than deleting mQgisModel.

I have tried this in my own building of master and 2.18.15 and no longer get the crash.

#4 Updated by Alessandro Pasotti almost 3 years ago

Can you make a pull request?

#5 Updated by Alessandro Pasotti almost 3 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Assignee set to Alessandro Pasotti

Nevermind: mQgisModel must be deleted otherwise it would leak, btw the order of destructors does matter here, so I'm now deleting the proxy model directly instead of leaving it to the parent (which is now a nullptr).

Btw, if you can take care of backporting my latest fixes to 2.18 it would be much appreciated.

See: https://github.com/qgis/QGIS/pull/5941

#6 Updated by Anonymous almost 3 years ago

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

#7 Updated by Steven Mizuno almost 3 years ago

Alessandro, I can try back porting the changes to 2.18. It may be a several days, however.

#8 Updated by Steven Mizuno almost 3 years ago

PR filed: https://github.com/qgis/QGIS/pull/6032

I have tested the changes in 2.18 from having no bookmarks to exporting and importing bookmarks, setting project bookmarks, and deleting both QGIS and project bookmarks. And no crash on closing QGIS if the bookmarks panel is floating.

#9 Updated by Giovanni Manghi over 2 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF