Still it the code should gracefully skip empty geometries. Can you create a 
ticket please?

From: mapserver-users [mailto:[email protected]] On 
Behalf Of Dave Barter
Sent: Friday, August 18, 2017 9:56 AM
To: [email protected]
Subject: Re: [mapserver-users] Segfault - LINE layer



As a quick workaround edit your DATA:

where type in ('trunk','motorway','primary') AND geometry is not null

-Jukka Rahkonen-


That will not work as an empty geometry is not null

The fix is WHERE NOT ST_EMPTY(geometry)




Lähettäjä: mapserver-users [mailto:[email protected]] 
Puolesta Dave Barter
Lähetetty: 18. elokuuta 2017 16:05
Vastaanottaja: 
[email protected]<mailto:[email protected]>
Aihe: Re: [mapserver-users] Segfault - LINE layer


On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) 
<[email protected]<mailto:[email protected]>> wrote:

I'd call it a bug. What version? Can you prepare a small test case?

MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS 
SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER 
SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG 
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

I have tracked it down to a specific geometry:-

010200000000000000 = ‘LINESTRING EMPTY’



________________________________
From: mapserver-users 
<[email protected]<mailto:[email protected]>>
 on behalf of Dave Barter <[email protected]<mailto:[email protected]>>
Sent: Friday, August 18, 2017 5:13:29 AM
To: [email protected]<mailto:[email protected]>
Subject: [mapserver-users] Segfault - LINE layer

This call:-

/usr/lib/cgi-bin/mapserv.ngx -nh 
"QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&STYLES=&BBOX=-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384&WIDTH=276&HEIGHT=276&FORMAT=image%2fpng&SRS=EPSG%3a3857&LAYERS=roads8&transparent=false

Is giving me:-

Segmentation fault (core dumped)

For the layer definition:-

LAYER
    GROUP "default"
    STATUS ON
    TYPE LINE
    MINSCALEDENOM 1300032
    MAXSCALEDENOM 2600064
    NAME "roads8"
    DEBUG 5
    CONNECTIONTYPE postgis
    PROCESSING "CLOSE_CONNECTION=DEFER"
    {%public_map_user%}
    PROJECTION
        "init=epsg:900913"
    END
    DATA "geometry from (select osm_id,geometry,name as name,ref,type from 
mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') 
order by z_order asc) as foo using unique osm_id using srid=900913"
    LABELITEM "name"
    CLASSITEM "type"
    CLASS
        EXPRESSION {primary,primary_link}
        STYLE
            WIDTH 0.5
            COLOR 242 242 242
        END
    END
    CLASS
        EXPRESSION "motorway"
        TEXT ("[ref]")
        STYLE
           WIDTH 1
           OUTLINEWIDTH 0.5
           OUTLINECOLOR 217 217 217
        END
        STYLE
            WIDTH 1
            COLOR 242 242 242

        END
    END
    CLASS
        EXPRESSION "trunk"
        TEXT ("[ref]")
        STYLE
           WIDTH 1
           OUTLINEWIDTH 0.5
           OUTLINECOLOR 217 217 217
        END
        STYLE
            WIDTH 1
             COLOR 242 242 242
        END
    END
END

When I look in my debug file I see the following as last set of lines:-

[Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7
[Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary"
[Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0
[Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] ""
[Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0
[Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] ""
[Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 
307691570
[Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting 
shape->resultindex = 327
[Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570
[Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING 
(139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 
6233447.9814142314717174)
[Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called.
[Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called.
[Fri Aug 18 11:09:39 2017].94

So it seems to segfault during  msPostGISReadShape.

I’ve checked the query and it is pulling 3110 linestrings from the database.

But I am not sure why is is segfaulting? Is this a bug?

Dave Barter
[email protected]<mailto:[email protected]>
@citizenfishy
www.phased.co.uk<http://www.phased.co.uk/>

_______________________________________________
mapserver-users mailing list
[email protected]<mailto:[email protected]>
https://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to