<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">As a quick workaround edit your DATA:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span lang="EN-US" style="font-size: 10pt;" class="">where type in ('trunk','motorway','primary') AND geometry is not null<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span lang="EN-US" style="font-size: 10pt;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span lang="EN-US" style="font-size: 10pt;" class="">-Jukka Rahkonen-</span></div></div></blockquote><div><br class=""></div><div><br class=""></div>That will not work as an empty geometry is not null</div><div><br class=""></div><div>The fix is WHERE NOT ST_EMPTY(geometry)</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">Lähettäjä:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span>mapserver-users [<a href="mailto:mapserver-users-bounces@lists.osgeo.org" style="color: purple; text-decoration: underline;" class="">mailto:mapserver-users-bounces@lists.osgeo.org</a>]<span class="Apple-converted-space"> </span><b class="">Puolesta<span class="Apple-converted-space"> </span></b>Dave Barter<br class=""><b class="">Lähetetty:</b><span class="Apple-converted-space"> </span>18. elokuuta 2017 16:05<br class=""><b class="">Vastaanottaja:</b><span class="Apple-converted-space"> </span><a href="mailto:mapserver-users@lists.osgeo.org" style="color: purple; text-decoration: underline;" class="">mapserver-users@lists.osgeo.org</a><br class=""><b class="">Aihe:</b><span class="Apple-converted-space"> </span>Re: [mapserver-users] Segfault - LINE layer<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div class=""><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) <<a href="mailto:steve.lime@state.mn.us" style="color: purple; text-decoration: underline;" class="">steve.lime@state.mn.us</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">I'd call it a bug. What version? Can you prepare a small test case?<span class="apple-converted-space"> </span><o:p class=""></o:p></span></div></div></div></blockquote><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">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<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">I have tracked it down to a specific geometry:-<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">010200000000000000 = ‘LINESTRING EMPTY’<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div class=""><div class="MsoNormal" align="center" style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: center;"><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><hr size="3" width="850" align="center" style="width: 510.1pt;" class=""></span></div><div id="x_divRplyFwdMsg" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span class="apple-converted-space"><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""> </span></span><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">mapserver-users <<a href="mailto:mapserver-users-bounces@lists.osgeo.org" style="color: purple; text-decoration: underline;" class="">mapserver-users-bounces@lists.osgeo.org</a>> on behalf of Dave Barter <<a href="mailto:dave@phased.co.uk" style="color: purple; text-decoration: underline;" class="">dave@phased.co.uk</a>><br class=""><b class="">Sent:</b><span class="apple-converted-space"> </span>Friday, August 18, 2017 5:13:29 AM<br class=""><b class="">To:</b><span class="apple-converted-space"> </span><a href="mailto:mapserver-users@lists.osgeo.org" style="color: purple; text-decoration: underline;" class="">mapserver-users@lists.osgeo.org</a><br class=""><b class="">Subject:</b><span class="apple-converted-space"> </span>[mapserver-users] Segfault - LINE layer</span><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""> <o:p class=""></o:p></span></div></div></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Helvetica, sans-serif;" class="">This call:-<br class=""><br class="">/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<br class=""><br class="">Is giving me:-<br class=""><br class="">Segmentation fault (core dumped)<br class=""><br class="">For the layer definition:-<br class=""><br class="">LAYER<br class="">    GROUP "default"<br class="">    STATUS ON<br class="">    TYPE LINE<br class="">    MINSCALEDENOM 1300032<br class="">    MAXSCALEDENOM 2600064<br class="">    NAME "roads8"<br class="">    DEBUG 5<br class="">    CONNECTIONTYPE postgis<br class="">    PROCESSING "CLOSE_CONNECTION=DEFER"<br class="">    {%public_map_user%}<br class="">    PROJECTION<br class="">        "init=epsg:900913"<br class="">    END<br class="">    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"<br class="">    LABELITEM "name"<br class="">    CLASSITEM "type"<br class="">    CLASS<br class="">        EXPRESSION {primary,primary_link}<br class="">        STYLE<br class="">            WIDTH 0.5<br class="">            COLOR 242 242 242<br class="">        END<br class="">    END<br class="">    CLASS<br class="">        EXPRESSION "motorway"<br class="">        TEXT ("[ref]")<br class="">        STYLE<br class="">           WIDTH 1<br class="">           OUTLINEWIDTH 0.5<br class="">           OUTLINECOLOR 217 217 217<br class="">        END<br class="">        STYLE<br class="">            WIDTH 1<br class="">            COLOR 242 242 242<br class=""><br class="">        END<br class="">    END<br class="">    CLASS<br class="">        EXPRESSION "trunk"<br class="">        TEXT ("[ref]")<br class="">        STYLE<br class="">           WIDTH 1<br class="">           OUTLINEWIDTH 0.5<br class="">           OUTLINECOLOR 217 217 217<br class="">        END<br class="">        STYLE<br class="">            WIDTH 1<br class="">             COLOR 242 242 242<br class="">        END<br class="">    END<br class="">END<br class=""><br class="">When I look in my debug file I see the following as last set of lines:-<br class=""><br class="">[Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7<br class="">[Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary"<br class="">[Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0<br class="">[Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] ""<br class="">[Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0<br class="">[Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] ""<br class="">[Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 307691570<br class="">[Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting shape->resultindex = 327<br class="">[Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570<br class="">[Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 6233447.9814142314717174)<br class="">[Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called.<br class="">[Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called.<br class="">[Fri Aug 18 11:09:39 2017].94<br class=""><br class="">So it seems to segfault during  msPostGISReadShape.<span class="apple-converted-space"> </span><br class=""><br class="">I’ve checked the query and it is pulling 3110 linestrings from the database.<span class="apple-converted-space"> </span><br class=""><br class="">But I am not sure why is is segfaulting? Is this a bug?<br class=""><br class="">Dave Barter<br class=""><a href="mailto:dave@phased.co.uk" style="color: purple; text-decoration: underline;" class="">dave@phased.co.uk</a><br class="">@citizenfishy<br class=""><a href="http://www.phased.co.uk/" style="color: purple; text-decoration: underline;" class="">www.phased.co.uk</a><br class=""><br class="">_______________________________________________<br class="">mapserver-users mailing list<br class=""><a href="mailto:mapserver-users@lists.osgeo.org" style="color: purple; text-decoration: underline;" class="">mapserver-users@lists.osgeo.org</a><br class=""><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" style="color: purple; text-decoration: underline;" class="">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a></span></div></div></div></blockquote></div></div></blockquote></div><br class=""></body></html>