[QGIS-Developer] Creating a WMS layer via PyQGIS triggers segfault

Trey Stafford trey.stafford at nsidc.org
Wed Mar 11 14:05:16 PDT 2020


We have encountered a problem in attempting to create WMS layers using 
PyQGIS (QGIS version 3.10.1 - installed from conda-forge).

Attempting to create a QgsRasterLayer with the `wms` provider results in 
a segmentation fault.

The following is a reproducible example. Running this code will cause 
the segmentation fault. Tested on Ubuntu 18.04.1, python 3.8.2.

    import qgis.core as qgc

    # Supply path to qgis install location

    qgc.QgsApplication.setPrefixPath("/path/to/qgis/installation", True)

    url = "http://www.glims.org/mapservice?VERSION=1.3.0&STYLES="

    print(qgc.QgsRasterLayer(url, 'GLIMS_GLACIERS', 'WMS'))

The only output from running the above code is the following (return 
code 139):

    Segmentation fault (core dumped)

Any advice or suggestions would be appreciated. If no one has any 
feedback, we will open a bug report.


Trey Stafford & Matt Fisher
National Snow and Ice Data Center (NSIDC)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200311/d45f6527/attachment.html>

More information about the QGIS-Developer mailing list