Bug report #15942
Bad GML causes crash
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | Even Rouault | ||
Category: | Web Services clients/WFS | ||
Affected QGIS version: | 2.18.7 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | Yes | Copied to github as #: | 23858 |
Description
I'm writing a WFS 2.0.0 server with GML 3.2. The GML I am serving up currently does NOT meet the GML spec and I didn't expect it to actually work in QGIS yet.
However, trying to add the layer caused QGIS to crash. I would expect an error message or other graceful handling of bad XML instead of a hard crash.
gdalinfo works against the XML without crashing.
I have attached the gml and backtrace (as reported by OSX) below.
I'm on Mac OSX, using the kyngchaos build 2.18.0 with no plugins installed.
Possible lead: When I fixed the namespace declarations in the original <wfs:FeatureCollection> tag QGIS no longer crashes, although the geometry is not displayed (though this is probably due to the GML still being incorrect).
Associated revisions
[GML parser/WFS provider] Fix crash when typename and geometry field name are identical (fixes #15942)
[GML parser/WFS provider] Fix crash when typename and geometry field name are identical (fixes #15942)
History
#1 Updated by Michael Moore almost 8 years ago
Shoot. I named the file bad_geojson.gml instead of bad_gml.gml. It is in fact GML and not GeoJSON.
Sorry for any confusion.
#2 Updated by Jürgen Fischer almost 8 years ago
- Status changed from Open to Closed
#3 Updated by Michael Moore almost 8 years ago
- File 3_GetFeature.xml added
- File 2_DescribeFeatureType.xml added
- File 1_GetCapabilities.xml added
After a more thorough inspection, it looks I've been able to set up a place where you can (probably) reproduce this.
1. Add http://stuporglue.org/qgis/ as a WFS Server Connection
2. Connect
3. Add the geom / walkin:geom layer
4. Crash
QGIS will make three WFS requests:
1. http://stuporglue.org/qgis/?SERVICE=WFS&REQUEST=GetCapabilities&VERSION=2.0.0
2. http://stuporglue.org/qgis/?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=2.0.0&TYPENAME=walkin:geom
3. http://stuporglue.org/qgis/?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=walkin:geom&STARTINDEX=0&COUNT=1&SRSNAME=urn:ogc:def:crs:EPSG::4326
It will crash after the 3rd.
I have attached the output of these three requests below.
In addition, you can see a .gif of QGIS crashing here: http://stuporglue.org/qgis/
#4 Updated by Michael Moore almost 8 years ago
Jürgen,
Can you tell me why this was closed so quickly?
It's an issue that causes a segfault in QGIS and it's reproducible with the instructions I provided in my latest comment.
Thanks,
Michael Moore
#5 Updated by Jürgen Fischer almost 8 years ago
- Tracker changed from Support to Feature request
- Project changed from QGIS Redmine (QGIS bug tracker) to QGIS Application
#6 Updated by Jürgen Fischer almost 8 years ago
- Tracker changed from Feature request to Bug report
- Status changed from Closed to Open
- Affected QGIS version set to 2.18.0
- Crashes QGIS or corrupts data set to No
#7 Updated by Giovanni Manghi over 7 years ago
- Subject changed from Bad GML can cause QGIS to crash with SIGSEGV to Bad GML causes crash
- Crashes QGIS or corrupts data changed from No to Yes
- Affected QGIS version changed from 2.18.0 to 2.18.4
- Target version set to Version 2.18
- Priority changed from Normal to High
- Category set to Web Services clients/WFS
#8 Updated by Giovanni Manghi over 7 years ago
- Easy fix? set to No
- Regression? set to No
#9 Updated by Giovanni Manghi over 7 years ago
- Description updated (diff)
- Affected QGIS version changed from 2.18.4 to 2.18.7
#10 Updated by Even Rouault about 7 years ago
- Assignee set to Even Rouault
#11 Updated by Even Rouault about 7 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset qgis|66518eb9ee609042de02f175a2f8e1b47ae22bc8.