Ticket #3365 (closed defect: fixed)

Opened 2 years ago

Last modified 22 months ago

Segfault when using Shapefile with empty geometry and tileindex

Reported by: adube Owned by: aboudreault
Priority: normal Milestone: 6.0 release
Component: MapServer C Library Version: 5.6
Severity: normal Keywords: tileindex, shapefile, empty, geometry
Cc: dmorissette

Description

Problem
When using a TILEINDEX with shapefiles that contain empty geometry values, MapServer crashes (segfault). The shapefiles were exported from a PostGIS database using shp2pgsql.

Other cases
1) When using a TILEINDEX with shapefiles that have no geometry property, MapServer outputs an error message, which is okay. The shapefiles were exported from a PostGIS database using ogr2ogr.

2) When using shapfiles that either contain empty geometry values or no geometry property, MapServer correctly renders the map.

More detailed explanations
The shapefiles were exported from a PostGIS database. They were normalized using the ST_Simplify method, which doesn't preserve the topology. I originally used pgsql2shp for the conversion and I use an index in my mapfile so I sometime had no map rendered at some spots and found out why (see Problem above).

Using ogr2ogr instead, 2) happens.

Solution
Switching to ST_SimplifyPreserveTopology solved my problem, but a crash is never normal (hence this ticket).

Sample
Attached is a sample demonstrating the problem. See the readme.txt file for more details.

Attachments

3365.tar.gz Download (62.2 KB) - added by adube 2 years ago.
Sample data with mapfile to reproduce the problem, see readme.txt for urls to use

Change History

Changed 2 years ago by adube

Sample data with mapfile to reproduce the problem, see readme.txt for urls to use

Changed 22 months ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

Thanks adube for the good test case. MapServer now exit properly and report the error message.

Fixed and committed in r10056.

Note: See TracTickets for help on using tickets.