Bug report #8724

Reprojecting and identifying a wms layer crashes QGIS

Added by Paolo Cavallini about 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Radim Blazek
Category:Web Services clients/WMS
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 #:17440

Description

1. load
url=http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map%3Dwmsambamm/rt_ambamm.idcomuni.rt.poly
EPSG:25832

2. activate OTF reprojection

3. crash

qgis.bin: malloc.c:2369: sysmalloc: Assertion `(old_top (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - _builtin_offsetof (struct malloc_chunk, fd)))) && old_size 0) || ((unsigned long) (old_size) >= (unsigned long)((((_builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.

Also using the Info tool and clicking around results in frequent crashes (do not know if related).

See also #5896

wms-identify-clc06-pt.png (7.81 KB) Radim Blazek, 2013-10-01 02:34 AM

53.png (212 KB) Giovanni Manghi, 2013-10-01 03:28 AM

08.png - not reprojected (183 KB) Giovanni Manghi, 2013-10-07 12:19 PM

11.png - reprojected (183 KB) Giovanni Manghi, 2013-10-07 12:19 PM

44.png (267 KB) Giovanni Manghi, 2013-10-10 03:24 AM

Associated revisions

Revision 96bd7e7f
Added by Radim Blazek about 6 years ago

give correct layer to QgsHighlight in QgsIdentifyResultsDialog, fixes #8724

Revision de8a5d62
Added by Radim Blazek about 6 years ago

Calculate better context (extent,size) if not given in WMS, WCS identify. Fixes #8724

History

#1 Updated by Giovanni Manghi about 6 years ago

  • Priority changed from High to Severe/Regression
  • Target version set to Future Release - High Priority
  • Affected QGIS version changed from 2.0.1 to master
  • Crashes QGIS or corrupts data changed from No to Yes

QGIS 2.0.1/master crashes when identifying reprojected WMS layer, see #5896-10

This issues do not affect qgis 1.8, so it is a regression.

#3 Updated by Giovanni Manghi about 6 years ago

I can't confirm the instant crash. But I confirm the crash when identifying the reprojected WMS layer and clicking on the result window when the format of the request is "feature", does not crash if the format of the request is "html" or "text".

I can't replicate with any other kind of file based raster, just wms, please leave feedback.

#4 Updated by Giovanni Manghi about 6 years ago

  • Category changed from Projection Support to Web Services clients/WMS
  • Subject changed from Reprojecting a raster crashes QGIS to Reprojecting and identifying a wms layer crashes QGIS

#5 Updated by Radim Blazek about 6 years ago

  • Assignee set to Radim Blazek

#6 Updated by Giovanni Manghi about 6 years ago

I forgot that with the projects attached in #5896-10

is easy to see also that the identify of reprojected wms layer returns wrong results.

#7 Updated by Radim Blazek about 6 years ago

It should be fixed in 96bd7e7 in master.

#8 Updated by Radim Blazek about 6 years ago

BTW, if I select the green area (see wms-identify-clc06-pt.png, project wms_identify_201_reprojected.qgs) the feature (bounding box in this case) is much larger. Is that correct on QGIS side? I.e. multipolygon is covering bigger area or overlapping polygons on server side?

#9 Updated by Giovanni Manghi about 6 years ago

Radim Blazek wrote:

BTW, if I select the green area (see wms-identify-clc06-pt.png, project wms_identify_201_reprojected.qgs) the feature (bounding box in this case) is much larger. Is that correct on QGIS side? I.e. multipolygon is covering bigger area or overlapping polygons on server side?

the correct BB is the one in the attached image, if in the reprojected layer you are seeing a different BB is because qgis is identifying the wrong feature (but it happens also with pixels of layers that on the server are rasters).

#10 Updated by Radim Blazek about 6 years ago

  • Status changed from Open to Closed

#11 Updated by Radim Blazek about 6 years ago

Giovanni Manghi wrote:

the correct BB is the one in the attached image, if in the reprojected layer you are seeing a different BB is because qgis is identifying the wrong feature (but it happens also with pixels of layers that on the server are rasters).

Now it is OK, in one moment it was giving to me wrong bbox for that area, cannot say why.

#12 Updated by Giovanni Manghi about 6 years ago

Radim Blazek wrote:

Giovanni Manghi wrote:

the correct BB is the one in the attached image, if in the reprojected layer you are seeing a different BB is because qgis is identifying the wrong feature (but it happens also with pixels of layers that on the server are rasters).

Now it is OK, in one moment it was giving to me wrong bbox for that area, cannot say why.

so this #5896 is fixed?

#13 Updated by Radim Blazek about 6 years ago

Giovanni Manghi wrote:

so this #5896 is fixed?

Fixed in master, not in 1.8. The bug is reported for both 2.x and 1.8.

#14 Updated by Giovanni Manghi about 6 years ago

Fixed in master, not in 1.8. The bug is reported for both 2.x and 1.8.

maybe the wrong identify when reprojecting wms layers is fixed but in master I see a regression (on master as well on 2.0.1):

Add this layer (postos de vigia)
crs=EPSG:3763&featureCount=10&format=image/png&layers=Postos%20de%20Vigia&styles=&url=http://mapas.dgterritorio.pt/wms/crif

from this server
http://mapas.dgterritorio.pt/wms/crif

in a new project, in one of the proposed CRSs and no reprojection.

  • on qgis 1.8 indentify works
  • on qgis 2.0.1/master the identify does not find anything

#15 Updated by Giovanni Manghi about 6 years ago

Fixed in master, not in 1.8. The bug is reported for both 2.x and 1.8.

I have just tested master (commit 4072e39227da578f6bd8f359a5197e6ea70ef874) and does not seems fixed. You can used the layers/projects you can find in #5896-9

or even with (in this case the identify does not work at all, works on 1.8)

http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/DTM_75M.map

#16 Updated by Radim Blazek about 6 years ago

Giovanni Manghi wrote:

I have just tested master (commit 4072e39227da578f6bd8f359a5197e6ea70ef874) and does not seems fixed. You can used the layers/projects you can find in #5896-9

I was testing with wms_identify_201_reprojected.qgs from #5896-10, please confirm if it works.

I can confirm that wms_identify_master.qgs from #5896-9 does not work but that is different issue, not that described in this bug report. Part of the response:

<!-- WARNING: The value 'Pontos de Agua_layer' is not valid in a XML tag context. -->
  <Pontos de Agua_layer>
<!-- WARNING: The value 'Pontos de Agua_feature' is not valid in a XML tag context. -->
    <Pontos de Agua_feature>

it is using "Pontos de Agua_layer" as XML tag which is not valid. So if you want to support non valid XML (do you?) it should be new feature request, I think.

#17 Updated by Giovanni Manghi about 6 years ago

Radim Blazek wrote:

Giovanni Manghi wrote:

I have just tested master (commit 4072e39227da578f6bd8f359a5197e6ea70ef874) and does not seems fixed. You can used the layers/projects you can find in #5896-9

I was testing with wms_identify_201_reprojected.qgs from #5896-10, please confirm if it works.

no, it does not. See attached images. The images refer to a identify click in that green feature in the middle of the map

I can confirm that wms_identify_master.qgs from #5896-9 does not work but that is different issue, not that described in this bug report. Part of the response:
[...]

it is using "Pontos de Agua_layer" as XML tag which is not valid. So if you want to support non valid XML (do you?) it should be new feature request, I think.

but it works in qgis 1.8. So from users point of view it is a regression, but I can understand that maybe it is not from another point of view. What do you think?

#18 Updated by Giovanni Manghi about 6 years ago

it is using "Pontos de Agua_layer" as XML tag which is not valid. So if you want to support non valid XML (do you?) it should be new feature request, I think.

why this is failing to identify (not reprojected) and in 1.8 works? Same reason?

http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/DTM_75M.map

#19 Updated by Radim Blazek about 6 years ago

Giovanni Manghi wrote:

no, it does not. See attached images. The images refer to a identify click in that green feature in the middle of the map

11.png shows exactly the problem I had (and ask if it is server side), then it was working and now I can reproduce it again. Are you sure that the server including data was not touched?

Other polygons, like those red and green above are working ok, right? So it should not be request in wrong CRS, I think.

Do you have access to the vector data? Could you verify if the big area PT-35699 has a hole (island) where is PT-36085. My suspicion is that it does not, and sometimes the server finds first the bigger area on the background.

but it works in qgis 1.8. So from users point of view it is a regression, but I can understand that maybe it is not from another point of view. What do you think?

Solution could be that identify will show the error in results dialog and user will be able to switch to another format (text).

#20 Updated by Radim Blazek about 6 years ago

Giovanni Manghi wrote:

it is using "Pontos de Agua_layer" as XML tag which is not valid. So if you want to support non valid XML (do you?) it should be new feature request, I think.

why this is failing to identify (not reprojected) and in 1.8 works? Same reason?

http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/WMS_v1.3/raster/DTM_75M.map

Probably. The dots in layer name EL.DTM.75 are suspicious, however valid in theory.

The server offers text/plain and application/vnd.ogc.gml, 2.x prefers gml because it is expected to carry more information, unfortunately it is not valid. 1.8 is using text.

We have to show the error and give chance to switch format.

#21 Updated by Giovanni Manghi about 6 years ago

Are you sure that the server including data was not touched?

100% sure

Other polygons, like those red and green above are working ok, right? So it should not be request in wrong CRS, I think.

no it is not working ok. Today (on master) using the identify on this wms layer (reprojected) produces the result in the attached image: now clicking on a feature seems to identify also all the ones around it.

Do you have access to the vector data? Could you verify if the big area PT-35699 has a hole (island) where is PT-36085. My suspicion is that it does not, and sometimes the server finds first the bigger area on the background.

this is the vector
http://www.igeo.pt/gdr/Downloads/ProdutosCLC/CLC06_PT.zip

and yes, there are no overlapped polygons so where PT-36085 is then PT-35699 has a hole.

Solution could be that identify will show the error in results dialog and user will be able to switch to another format (text).

yes, this must be done then, because at this moment if the server does not support feature/gml then there is not way for the user to choose text and the result is that he thinks that the identify does not work or that the server has a problem.

#22 Updated by Giovanni Manghi about 6 years ago

#23 Updated by Giovanni Manghi about 6 years ago

We have to show the error and give chance to switch format.

agree

#24 Updated by Radim Blazek about 6 years ago

It should be fixed in de8a5d6.

When WMS is reprojected, the identify tool does not know context (extent,size) in layer original CRS and calls identify() without context. The provider was using full extent but small resolution.

#25 Updated by Radim Blazek about 6 years ago

Giovanni Manghi wrote:

yes, this must be done then, because at this moment if the server does not support feature/gml then there is not way for the user to choose text and the result is that he thinks that the identify does not work or that the server has a problem.

The problem is not if the server does not support GML (in that case it is used a different format) but when the response is not valid GML.

#26 Updated by Radim Blazek about 6 years ago

Fixed also the problem with invalid GML in d5f167f. The error is shown in results dialog and user can switch format.

Also available in: Atom PDF