Bug report #15358

QGis 2.16 crashes if the qt4-sqlite3 library not installed

Added by vince - over 3 years ago. Updated over 2 years ago.

Status:Closed
Priority:Low
Assignee:-
Category:Unknown
Affected QGIS version:2.16.0 Regression?:No
Operating System:MacOS X Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:23290

Description

When the qt4-sqlite3 plug-in is not installed, QGis displays an error message at start (related to the bookmarks database), as if the error wasn’t fatal, then proceeds to launch. However, it crashes just after:

Air > lldb /Applications/MacPorts/QGIS.app/Contents/MacOS/QGIS
(lldb) target create "/Applications/MacPorts/QGIS.app/Contents/MacOS/QGIS" 
Current executable set to '/Applications/MacPorts/QGIS.app/Contents/MacOS/QGIS' (x86_64).
(lldb) run
Process 53550 launched: '/Applications/MacPorts/QGIS.app/Contents/MacOS/QGIS' (x86_64)
Warning: loading of qgis translation failed [/Applications/MacPorts/QGIS.app/Contents/MacOS/../Resources/i18n//qgis_en_US]
Warning: loading of qt translation failed [/opt/local/libexec/qt4/share/translations/qt_en_US]
Warning: QSqlDatabase: QSQLITE driver not loaded
Warning: QSqlDatabase: available drivers: 
ERROR: Opening of authentication db FAILED
ERROR: Unable to establish authentication database connection
ERROR: Auth db could not be created and opened
Warning: QSqlDatabase: QSQLITE driver not loaded
Warning: QSqlDatabase: available drivers: 
2016-07-28 10:17:09.219 QGIS[53550:90576] modalSession has been exited prematurely - check for a reentrant call to endModalSession:
Warning: QCss::Parser - Failed to load file  "/style.qss" 
Warning: QLayout: Attempting to add QLayout "" to QgsPanelWidgetStack "mWidgetStack", which already has a layout
ERROR: Opening of authentication db FAILED
Warning: QSqlQuery::prepare: database not open
WARNING: Auth db query exec() FAILED
Process 53550 stopped
* thread #1: tid = 0x161d0, 0x000000010061b05f libqgis_app.2.16.0.dylib`QgsBookmarks::~QgsBookmarks(this=0x000000015b6c78a0) + 47 at qgsbookmarks.cpp:116, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x7fff00000032)
    frame #0: 0x000000010061b05f libqgis_app.2.16.0.dylib`QgsBookmarks::~QgsBookmarks(this=0x000000015b6c78a0) + 47 at qgsbookmarks.cpp:116
   113     
   114     QgsBookmarks::~QgsBookmarks()
   115     {
-> 116       delete mQgisModel;
   117       delete mProjectModel;
   118       QSqlDatabase::removeDatabase( "bookmarks" );
   119       saveWindowLocation();
(lldb) quit

Prolly this object has not been properly created and trying to delete it causes the crash. It could be a good idea to add a test to find out if that object exists or not.

Associated revisions

Revision 285bcd05
Added by Jürgen Fischer over 3 years ago

fix crash when QSQLITE is unavailable (fixes #15358)

Revision 90d3c8b9
Added by Jürgen Fischer over 3 years ago

fix crash when QSQLITE is unavailable (fixes #15358)

(cherry picked from commit 285bcd053c353bd99f7e8e71003f5b4bd39bde57)

Revision 7401dd31
Added by Jürgen Fischer over 3 years ago

fix crash when QSQLITE is unavailable (fixes #15358)

(cherry picked from commit 285bcd053c353bd99f7e8e71003f5b4bd39bde57)

History

#1 Updated by vince - over 3 years ago

  • Crashes QGIS or corrupts data changed from No to Yes

#2 Updated by Matthias Kuhn over 3 years ago

How did you install QGIS?

#3 Updated by Giovanni Manghi over 3 years ago

  • Status changed from Open to Feedback
  • Subject changed from QGis 2.16 crashes if the QSQLITE plug-in is not installed to QGis 2.16 crashes if the qt4-sqlite3 library not installed

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

  • Status changed from Feedback to Closed

#5 Updated by Jürgen Fischer over 2 years ago

  • Category set to Unknown

Also available in: Atom PDF