Bug report #14401

QGIS Crashes if WFS credentials are invalid

Added by dr - over 4 years ago. Updated about 3 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Unknown
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 #:22382

Description

1. View -> Panels -> Check [Browser Panel]
2. Layer -> Add Layer -> Add WFS Layer -> New -> (Name: NextGIS, URL: http://demo.nextgis.ru/ngw/api/resource/239/wfs, login/password: qgis/ve3Se) -> Connect -> Add [admin] layer to canvas
3. Press [Refresh] button in [Browser Panel]
4. In [Browser Panel] tree go to WFS -> Nextgis -> Edit. Change Username to different, for example qgis1
5. Restart QGIS
6. Go to [Browser Panel] -> NextGIS. In [Enter Credentials] window remain Username unchanged (qgis1) and press OK. QGIS Crashes.

After this I cannot run QGIS because it crashes on startup. Traceback:

...
src/core/qgsbrowsermodel.cpp: 308: (findPath) [0ms] Arrived favourites:
src/core/qgsbrowsermodel.cpp: 308: (findPath) [0ms] Arrived wfs:/NextGIS
src/gui/qgsbrowsertreeview.cpp: 111: (expandTree) [0ms] itemPath = favourites:
src/gui/qgsbrowsertreeview.cpp: 111: (expandTree) [0ms] itemPath = wfs:/NextGIS
src/gui/qgsbrowsertreeview.cpp: 111: (expandTree) [0ms] itemPath = wfs:
src/core/qgsbrowsermodel.cpp: 506: (fetchMore) [1ms] Entered
src/core/qgsbrowsermodel.cpp: 512: (fetchMore) [0ms] path = wfs:/NextGIS
src/core/qgsdataitem.cpp: 360: (populate) [0ms] mPath = wfs:/NextGIS
src/core/qgsdataitem.cpp: 647: (setState) [0ms] item wfs:/NextGIS set state 0 -> 1
src/core/qgsdataitem.cpp: 84: (connectFrameChanged) [0ms] mCount = 2
src/core/qgsdataitem.cpp: 346: (emitStateChanged) [0ms] item wfs:/NextGIS state changed 0 -> 1
src/core/qgsbrowsermodel.cpp: 413: (itemStateChanged) [0ms] Entered
src/core/qgsbrowsermodel.cpp: 419: (itemStateChanged) [0ms] item wfs:/NextGIS state changed 0 -> 1
src/core/qgsdataitem.cpp: 382: (runCreateChildren) [1ms] [thread:0x88ad7f0] path = wfs:/NextGIS
src/providers/wfs/qgswfsdataitems.cpp: 60: (createChildren) [0ms] [thread:0x88ad7f0] mUri = password=ve3Se&url=http://demo.nextgis.ru/ngw/api/resource/239/wfs&username=qgis1
src/providers/wfs/qgswfscapabilities.cpp: 35: (QgsWFSCapabilities) [0ms] [thread:0x88ad7f0] theUri = password=ve3Se&url=http://demo.nextgis.ru/ngw/api/resource/239/wfs&username=qgis1
src/providers/wfs/qgswfscapabilities.cpp: 38: (QgsWFSCapabilities) [0ms] [thread:0x88ad7f0] mBaseUrl = http://demo.nextgis.ru/ngw/api/resource/239/wfs?
src/providers/wfs/qgswfscapabilities.cpp: 155: (setAuthorization) [0ms] [thread:0x88ad7f0] entered
src/providers/wfs/qgswfscapabilities.cpp: 162: (setAuthorization) [0ms] [thread:0x88ad7f0] setAuthorization qgis1
Warning: QObject: Cannot create children for a parent that is in a different thread.
(Parent is QgsNetworkAccessManager(0x12482b0), parent's thread is QThread(0x105aa50), current thread is QThread(0x88ad7f0)
Stacktrace (piped through c++filt):
src/core/qgsmessagelog.cpp: 45: (logMessage) [6ms] [thread:0x88ad7f0] 2016-03-02T14:25:31 Qt[1] QObject: Cannot create children for a parent that is in a different thread.
(Parent is QgsNetworkAccessManager(0x12482b0), parent's thread is QThread(0x105aa50), current thread is QThread(0x88ad7f0)
src/core/qgsnetworkaccessmanager.cpp: 91: (queryProxy) [0ms] [thread:0x88ad7f0] using fallback proxy for http://demo.nextgis.ru/ngw/api/resource/239/wfs?SERVICE=WFS&REQUEST=GetCapabilities&VERSION=1.0.0
/usr/bin/qgis.bin[0x405747]
/usr/bin/qgis.bin[0x40592d]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qt_message_output(QtMsgType, char const*)+0x21)[0x7fb4bc919bb1]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x70ff9)[0x7fb4bc919ff9]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(qWarning(char const*, ...)+0x94)[0x7fb4bc91a244]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x18e2e3)[0x7fb4bca372e3]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QObject::QObject(QObjectPrivate&, QObject*)+0xa8)[0x7fb4bca3fec8]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(QIODevice::QIODevice(QIODevicePrivate&, QObject*)+0x9)[0x7fb4bc9b3109]
/usr/lib/x86_64-linux-gnu/libQtNetwork.so.4(QNetworkReply::QNetworkReply(QNetworkReplyPrivate&, QObject*)+0x9)[0x7fb4b6fa8f89]
/usr/lib/x86_64-linux-gnu/libQtNetwork.so.4(+0x7dd8e)[0x7fb4b6fabd8e]
/usr/lib/x86_64-linux-gnu/libQtNetwork.so.4(QNetworkAccessManager::createRequest(QNetworkAccessManager::Operation, QNetworkRequest const&, QIODevice*)+0x303)[0x7fb4b6f8fb53]
/usr/lib/libqgis_core.so.2.15.0(QgsNetworkAccessManager::createRequest(QNetworkAccessManager::Operation, QNetworkRequest const&, QIODevice*)+0x73f)[0x7fb4bd1edb2d]
/usr/lib/x86_64-linux-gnu/libQtNetwork.so.4(QNetworkAccessManager::get(QNetworkRequest const&)+0x14)[0x7fb4b6f8cd94]
/usr/lib/qgis/plugins/libwfsprovider.so(QgsWFSCapabilities::requestCapabilities()+0x189)[0x7fb41803cbff]
/usr/lib/qgis/plugins/libwfsprovider.so(QgsWFSConnectionItem::createChildren()+0x136)[0x7fb41803f54e]
/usr/lib/libqgis_core.so.2.15.0(QgsDataItem::runCreateChildren(QgsDataItem*)+0xcb)[0x7fb4bd0a0f8d]
/usr/lib/libqgis_core.so.2.15.0(+0x31e27b)[0x7fb4bd0ac27b]
/usr/lib/libqgis_core.so.2.15.0(+0x31e16a)[0x7fb4bd0ac16a]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x6efee)[0x7fb4bc917fee]
/usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x7b32f)[0x7fb4bc92432f]
src/core/qgsdataitem.cpp: 402: (childrenCreated) [27ms] path = mssql: children.size() = 0
src/core/qgsdataitem.cpp: 425: (populate) [0ms] mPath = mssql:
src/core/qgsdataitem.cpp: 647: (setState) [0ms] item mssql: set state 1 -> 2
src/core/qgsdataitem.cpp: 94: (disconnectFrameChanged) [0ms] mCount = 1
src/core/qgsbrowsermodel.cpp: 413: (itemStateChanged) [0ms] Entered
src/core/qgsbrowsermodel.cpp: 419: (itemStateChanged) [0ms] item mssql: state changed 1 -> 2
src/core/qgsmaprenderer.cpp: 208: (adjustExtentToSize) [5ms] Map units per pixel (x,y) : 0, 0
src/core/qgsmaprenderer.cpp: 209: (adjustExtentToSize) [0ms] Pixmap dimensions (x,y) : 1495, 902
src/core/qgsmaprenderer.cpp: 210: (adjustExtentToSize) [0ms] Extent dimensions (x,y) : 0, 0
src/core/qgsmaprenderer.cpp: 211: (adjustExtentToSize) [0ms] Empty
src/core/qgsmaprenderer.cpp: 219: (adjustExtentToSize) [0ms] Adjusted map units per pixel (x,y) : 0, 0
src/core/qgsmaprenderer.cpp: 221: (adjustExtentToSize) [0ms] Recalced pixmap dimensions (x,y) : nan, nan
src/core/qgsscalecalculator.cpp: 128: (calculateGeographicDistance) [0ms] Distance across map extent (m): 0
src/core/qgsscalecalculator.cpp: 85: (calculate) [0ms] scale = 0 conversionFactor = 39.3701
src/core/qgsmaprenderer.cpp: 226: (adjustExtentToSize) [0ms] Scale (assuming meters as map units) = 1:0
Segmentation fault (core dumped)

Related issues

Related to QGIS Application - Bug report #13271: QGIS fails to launch or hang while exiting due to thread ... Closed 2015-08-26
Related to QGIS Application - Bug report #14192: Multi-threaded usage of QgsNetworkAccessManager Closed 2016-01-28

Associated revisions

Revision 2eb82430
Added by Jürgen Fischer over 4 years ago

use individual network managers for threads (fixes #13721, fixes #14401, implements #14192)

Revision c128a552
Added by Jürgen Fischer over 4 years ago

use individual network managers for threads (fixes #13721, fixes #14401, implements #14192)

(cherry picked from commit 2eb82430bbdb02b0789b3ffe80d5b6fd747fa8cc)

History

#1 Updated by dr - over 4 years ago

It looks like consequence of #13271

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

  • Status changed from Open to Closed

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

  • Category set to Unknown

Also available in: Atom PDF