Bug report #16233

regression: deleting a saved wms/wmts server crashes QGIS

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

Status:Closed
Priority:Severe/Regression
Assignee:Alessandro Pasotti
Category:GUI
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 #:24143

Description

I'm pretty sure this is a regression from the QgsSettings PR (#e1ede700a897c899be8aabf20abe7f953209cb10). When the user tries to delete a saved wms/wmts server via its UI's [ remove ] button, QGIS crashes. This is the gdb's where output:

Thread 1 "qgis" received signal SIGSEGV, Segmentation fault.
0x00007ffff402a47d in QSettings::remove(QString const&) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
(gdb) where
#0  0x00007ffff402a47d in QSettings::remove(QString const&) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x00007ffff5c3e415 in QgsSettings::remove(QString const&) ()
   from /home/webmaster/dev/cpp/QGIS/bm-qt5/output/lib/libqgis_core.so.2.99.0
#2  0x00007fff3e606643 in QgsWMSConnection::deleteConnection(QString const&) ()
   from /home/webmaster/dev/cpp/QGIS/bm-qt5/output/lib/qgis/plugins/libwmsprovider.so
#3  0x00007fff3e5ee4a0 in QgsWMSSourceSelect::on_btnDelete_clicked() ()
   from /home/webmaster/dev/cpp/QGIS/bm-qt5/output/lib/qgis/plugins/libwmsprovider.so
#4  0x00007fff3e61a03e in QgsWMSSourceSelect::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
   from /home/webmaster/dev/cpp/QGIS/bm-qt5/output/lib/qgis/plugins/libwmsprovider.so
#5  0x00007fff3e61a3e0 in QgsWMSSourceSelect::qt_metacall(QMetaObject::Call, int, void**) ()
   from /home/webmaster/dev/cpp/QGIS/bm-qt5/output/lib/qgis/plugins/libwmsprovider.so
#6  0x00007ffff40e9644 in QMetaObject::activate(QObject*, int, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff4e7dc12 in QAbstractButton::clicked(bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x00007ffff4e7de64 in ?? ()
Steps to reproduce
  1. Launch QGIS
  2. Open the Add WMS layer window
  3. Select a saved server from the combo box
  4. Click on the [ remove ] button, and the [ ok ] button on the follow-up dialog
  5. Notice QGIS dies :)

Associated revisions

Revision e045b369
Added by Alessandro Pasotti over 2 years ago

Fixes segfault in QgsSettings::clear, fixes #16233

mGlobalSettings is read-only and can be a nullptr
that QSettings instance should never be modified
nor assumed to be instanciated

History

#1 Updated by Alessandro Pasotti over 2 years ago

  • Assignee changed from Nathan Woodrow to Alessandro Pasotti

The fix is trivial but I'm on vacation and away from my dev PC, I'll fix it later this week.

See https://github.com/qgis/QGIS/pull/4160/files#r103233230

#2 Updated by Anonymous over 2 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF