Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in QgsWFSProvider::getCapabilities #60622

Closed
1 of 2 tasks
kommen opened this issue Feb 15, 2025 · 4 comments · Fixed by #60653
Closed
1 of 2 tasks

Crash in QgsWFSProvider::getCapabilities #60622

kommen opened this issue Feb 15, 2025 · 4 comments · Fixed by #60653
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@kommen
Copy link

kommen commented Feb 15, 2025

What is the bug or the crash?

Testing @m-kuhn's Mac Qt6 build from #60039 (comment)

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x18d3595d0 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x18d391c20 pthread_kill + 288
2   libsystem_c.dylib             	       0x18d2681e0 raise + 32
3   libpython3.11.dylib           	       0x106fb20e8 faulthandler_fatal_error + 548
4   libsystem_platform.dylib      	       0x18d3c2584 _sigtramp + 56
5   libsystem_pthread.dylib       	       0x18d391c20 pthread_kill + 288
6   libsystem_c.dylib             	       0x18d29ea30 abort + 180
7   libc++abi.dylib               	       0x18d348d08 abort_message + 132
8   libc++abi.dylib               	       0x18d338fc0 demangling_terminate_handler() + 348
9   libobjc.A.dylib               	       0x18cfd3c00 _objc_terminate() + 160
10  libc++abi.dylib               	       0x18d3480cc std::__terminate(void (*)()) + 16
11  libc++abi.dylib               	       0x18d34b348 __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 88
12  libc++abi.dylib               	       0x18d34b28c __cxa_throw + 308
13  libqgis_core.3.41.0.dylib     	       0x117df37e4 QgsCoordinateTransform::transformBoundingBox(QgsRectangle const&, Qgis::TransformDirection, bool) const + 3044
14  libprovider_wfs.so            	       0x150a05f78 QgsWFSProvider::getCapabilities() + 2900
15  libprovider_wfs.so            	       0x150a04ccc QgsWFSProvider::QgsWFSProvider(QString const&, QgsDataProvider::ProviderOptions const&, QgsWfsCapabilities::Capabilities const&) + 1800
16  libprovider_wfs.so            	       0x150a0ab94 QgsWFSProvider::QgsWFSProvider(QString const&, QgsDataProvider::ProviderOptions const&, QgsWfsCapabilities::Capabilities const&) + 52
17  libprovider_wfs.so            	       0x150a1f2a8 QgsWfsProviderMetadata::createProvider(QString const&, QgsDataProvider::ProviderOptions const&, QFlags<Qgis::DataProviderReadFlag>) + 124
18  libqgis_core.3.41.0.dylib     	       0x118e90ee0 QgsProviderRegistry::createProvider(QString const&, QString const&, QgsDataProvider::ProviderOptions const&, QFlags<Qgis::DataProviderReadFlag>) + 356
19  libqgis_core.3.41.0.dylib     	       0x1176ab684 QgsVectorLayer::setDataProvider(QString const&, QgsDataProvider::ProviderOptions const&, QFlags<Qgis::DataProviderReadFlag>) + 1236
20  libqgis_core.3.41.0.dylib     	       0x1176aa440 QgsVectorLayer::readXml(QDomNode const&, QgsReadWriteContext&) + 960
21  libqgis_core.3.41.0.dylib     	       0x11866e834 QgsMapLayer::readLayerXml(QDomElement const&, QgsReadWriteContext&, QFlags<QgsMapLayer::ReadFlag>, QgsDataProvider*) + 3468
22  libqgis_core.3.41.0.dylib     	       0x117e1c9b8 QgsProject::addLayer(QDomElement const&, QList<QDomNode>&, QgsReadWriteContext&, QFlags<Qgis::ProjectReadFlag>, QgsDataProvider*) + 2008
23  libqgis_core.3.41.0.dylib     	       0x117e1a95c QgsProject::_getMapLayers(QDomDocument const&, QList<QDomNode>&, QFlags<Qgis::ProjectReadFlag>) + 5948
24  libqgis_core.3.41.0.dylib     	       0x117e247f8 QgsProject::readProjectFile(QString const&, QFlags<Qgis::ProjectReadFlag>) + 20120

Steps to reproduce the issue

Minimal repro project: wfscrash.qgz.zip

  1. open this project
  2. crash

Versions

QGIS version3.41.0-Master
QGIS code revision36a0ec44
 
Libraries
Qt version6.8.1
Python version3.11.10
GDAL/OGR version3.9.3
PROJ version9.5.1
EPSG Registry database versionv11.022 (2024-11-05)
GEOS version3.13.0-CAPI-1.19.0
SQLite version3.47.2
PDAL version2.8.1
PostgreSQL client version16.4
SpatiaLite version5.1.0
QWT version6.3.0
QScintilla2 version2.14.1
OS versionmacOS Sonoma (14.7)
 
Active Python plugins
processing2.12.99
grassprovider2.12.99
db_manager0.1.20
MetaSearch0.3.6

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

The crash doesn't reproduce with current stable version 3.40.3

@kommen kommen added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 15, 2025
@m-kuhn
Copy link
Member

m-kuhn commented Feb 16, 2025

Thanks for reporting.
The WFS provider GetCapabilities parser should catch QgsCsExceptions (as done in many other places in the code already):

mShared->mCapabilityExtent = ct.transformBoundingBox( r, Qgis::TransformDirection::Forward );

A pull request will be happily accepted (I am not in a position right now to do it myself).

If you could check if CRS reprojection works properly in the mac builds that would also be valuable (I don't have a mac right now).

@kommen
Copy link
Author

kommen commented Feb 16, 2025

If you could check if CRS reprojection works properly in the mac builds that would also be valuable (I don't have a mac right now).

Tried a few reprojections and all seems to work as expected to me in the latest mac build (36a0ec44).

(I am not in a position right now to do it myself)

Me neither, sorry.

One more observation:
The mac build from 3 weeks ago QGIS code revision 53241f0d (also downloaded from #60039 (comment) doesn't crash.

Looking at the changelog to qgswfsprovider.cpp, can this be a regression from #60191?

EDIT:
More likely, the change which caused/surfaced this is https://github.com/qgis/QGIS/pull/60331/files#diff-a1afac99a443c88983efc2c30e94ab2b5caf594aa53c4e0d7c4935dbd12c27a5

@nyalldawson
Copy link
Collaborator

@kommen it will be caused by #60331, but in this case the wfs provider is wrong, not that change

@kommen kommen changed the title Crash in QgsCoordinateTransform::transformBoundingBox Crash in QgsWFSProvider::getCapabilities Feb 16, 2025
@kommen
Copy link
Author

kommen commented Feb 16, 2025

@nyalldawson I see, thanks for the clarification! I have adjusted the issue title to better reflect this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants