Bug report #3343

segfault loading more wms layers into a raster layer

Added by Giuseppe Sucameli about 11 years ago. Updated about 11 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Rasters
Affected QGIS version: Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:13403

Description

A segfault occurs using python to load more than one wms layers into one raster layer.
Instead, all works fine using the "Add WMS layer" GUI to do the same, so I don't know if it's a python binding issue.

The following code snippet is the same code present in the PyQGIS doc, except that it tries to load more wms layers.

url = 'http://wms.jpl.nasa.gov/wms.cgi'
layers = [ 'global_mosaic', 'global_mosaic_base' ]
styles = [ 'pseudo' ]
format = 'image/jpeg'
crs = 'EPSG:4326'
rlayer = [[QgsRasterLayer]](0, url, 'some layer name', 'wms', layers, styles, format, crs)
if not rlayer.isValid():
    print "Layer failed to load!" 

[[QgsMapLayerRegistry]].instance().addMapLayer(rlayer)

Running the last row to add the layer to the canvas I get segfault.
I'm sure the error occurs when the rendering starts. Indeed disabling the renderFlag no segfaults occur until I re-enable it.

Sometimes I get a core-dumped. See the attachments.

core-dumped.txt Magnifier - core-dumped (13.2 KB) Giuseppe Sucameli, 2010-12-16 05:52 AM

Associated revisions

Revision e2df4735
Added by Jürgen Fischer about 11 years ago

fix #3343

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 542f1ecb
Added by Jürgen Fischer about 11 years ago

fix #3343

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#2 Updated by Giuseppe Sucameli about 11 years ago

Replying to [comment:1 jef]:

Could you try with a different server WMS? I've just recompiled QGis and it still crashes.

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

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in 542f1ecb (SVN r14930). You need to specify a style for each layer.

Also available in: Atom PDF