mapserv segfaults
John C Cartwright
John.C.Cartwright at NOAA.GOV
Thu Feb 10 13:04:26 EST 2005
sorry - betraying my ignorance of gdb! Here it is:
=========================================================================
(gdb) run
Starting program: /extra/contrib/apache/cgi-bin/mapserv-debug
[Thread debugging using libthread_db enabled]
[New Thread -1218604192 (LWP 19920)]
[Thu Feb 10 10:56:18 2005].796695 msWMSLoadGetMapParams(): enabling
non-square pixels.[Thu Feb 10 10:56:18 2005].799902 msDrawMap(): kicking
into non-square pixel preserving mode.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1218604192 (LWP 19920)]
0x006a10d1 in realloc () from /lib/tls/libc.so.6
(gdb) where
#0 0x006a10d1 in realloc () from /lib/tls/libc.so.6
#1 0x007bb3dd in _TIFFrealloc () from
/extra/contrib/esri/sdeexe90/lib/libtiff.so
#2 0x00ffca3f in TIFFMergeFieldInfo () from
/extra/contrib/gdal-1.2.5/lib/libgdal.so.1
#3 0x0102fd2c in _XTIFFLocalDefaultDirectory ()
from /extra/contrib/gdal-1.2.5/lib/libgdal.so.1
#4 0x0102fd51 in _XTIFFDefaultDirectory () from
/extra/contrib/gdal-1.2.5/lib/libgdal.so.1
#5 0x007a24ae in TIFFDefaultDirectory () from
/extra/contrib/esri/sdeexe90/lib/libtiff.so
#6 0x007a3098 in TIFFReadDirectory () from
/extra/contrib/esri/sdeexe90/lib/libtiff.so
#7 0x007b718c in TIFFClientOpen () from
/extra/contrib/esri/sdeexe90/lib/libtiff.so
#8 0x007bb2dc in TIFFFdOpen () from
/extra/contrib/esri/sdeexe90/lib/libtiff.so
#9 0x007bb36b in TIFFOpen () from
/extra/contrib/esri/sdeexe90/lib/libtiff.so
#10 0x0102fddc in XTIFFOpen () from
/extra/contrib/gdal-1.2.5/lib/libgdal.so.1
#11 0x00f7fd04 in GTiffDataset::Open () from
/extra/contrib/gdal-1.2.5/lib/libgdal.so.1
#12 0x010361c9 in GDALOpen () from
/extra/contrib/gdal-1.2.5/lib/libgdal.so.1
#13 0x08079ff3 in msDrawRasterLayerLow (map=0xb75a3008, layer=0x93a32e8,
image=0x9512f48)
at mapraster.c:1450
#14 0x0808ce85 in msDrawRasterLayer (map=0xb75a3008, layer=0x763538,
image=0x0)
at mapdraw.c:1145
#15 0x0808bf3b in msDrawLayer (map=0xb75a3008, layer=0x93a32e8,
image=0x9512f48)
at mapdraw.c:781
#16 0x0808b62f in msDrawMap (map=0xb75a3008) at mapdraw.c:446
#17 0x080ce044 in msWMSGetMap (map=0xb75a3008, nVersion=65793,
names=0x938b578,
values=0x93951c0, numentries=7) at mapwms.c:2156
#18 0x080cfab2 in msWMSDispatch (map=0xb75a3008, req=0x938b558) at
mapwms.c:2920
#19 0x080a13ce in msOWSDispatch (map=0xb75a3008, request=0x938b558) at
mapows.c:245
#20 0x0805234d in main (argc=0, argv=0xbfffb644) at mapserv.c:1165
(gdb)
=========================================================================
Looks like a problem with TIFF support, but here's the output from
gdal-info:
gdal-config --formats
gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm sdts raw dted mem
jdem envisat elas fit vrt usgsdem l1b nitf bmp pcidsk airsar rs2 bsb gif
jpeg png netcdf zlib
The mapfile (supplied by Perry Nacionales) is attached.
Thanks!
-- john
Sean Gillies wrote:
> Type "where" at the gdb prompt after the segfault and post the result
> for us. Sorry, I should have mentioned this before.
>
> As you are not specifying height/width and bbox in your query string,
> the default values specified in your map config file will be very
> important. Can you attach your map file as well?
>
> cheers,
> Sean
>
> On Feb 10, 2005, at 9:47 AM, John C Cartwright wrote:
>
>> Hi Sean,
>>
>> thanks for the suggestion. here's the output:
>>
>> (gdb) run
>> Starting program: /extra/contrib/apache/cgi-bin/mapserv-debug
>> [Thread debugging using libthread_db enabled]
>> [New Thread -1218604192 (LWP 19250)]
>> [Thu Feb 10 09:40:19 2005].204455 msWMSLoadGetMapParams(): enabling
>> non-square pixels.[Thu Feb 10 09:40:19 2005].208427 msDrawMap(): kicking
>> into non-square pixel preserving mode.
>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to Thread -1218604192 (LWP 19250)]
>> 0x0095b0d1 in realloc () from /lib/tls/libc.so.6
>>
>> Here's the query string:
>>
>> map=/extra/contrib/apache/htdocs/mapserver/wms_wfs/
>> wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=relief,cities_p
>> oly,counties,states,roads
>>
>> and this is a RedHat ES 3 system (kernel 2.4.21-27.0.1.ELsmp)
>>
>> Where should I go from here?
>>
>> Thanks again!
>>
>> -- john
>>
>>
>> Sean Gillies wrote:
>>
>>> John, add a
>>>
>>> DEBUG ON
>>>
>>> to the Map-level block in your map config file. This will write
>>> messages to stderr, including names of layers being accessed. This
>>> should let you know which layer (if any) is associated with the
>>> segfault.
>>>
>>> Now that you've recompiled, run mapserv under gdb exactly as Steve
>>> Woodbridge described. This time gdb should give a more detailed
>>> description of the location of the memory error including all the
>>> MapServer functions that have been called. Give us a look at that and
>>> we can try to figure out what's going on.
>>>
>>> cheers,
>>> Sean
>>>
>>> On Feb 9, 2005, at 5:28 PM, John C Cartwright wrote:
>>>
>>>> Thanks, Sean. I recompiled with debugging, can you provide me a little
>>>> guidance on what would be helpful to get out of gdb?
>>>>
>>>> ...
>>>> Thanks again for your patience and help!
>>>>
>>>> -- john
>>>>
>>>
>>>> Sean Gillies wrote:
>>>>
>>>>> John,
>>>>> Looks to me like you need to re-config mapserver with
>>>>> --enable-debug so
>>>>> that gdb can tell us more about the calling stack.
>>>>> cheers,
>>>>> Sean
>>>>> On Feb 9, 2005, at 5:08 PM, John C Cartwright wrote:
>>>>>
>>>>>> Hi Steve,
>>>>>>
>>>>>> thanks for the prompt response and the suggestion.
>>>>>>
>>>>>> gdb is just telling me the error occurred in memory allocation, but
>>>>>> this
>>>>>> is not helping me much:
>>>>>>
>>>>>> (gdb) run
>>>>>> Starting program: /extra/contrib/apache/cgi-bin/mapserver-4.4.1
>>>>>> [Thread debugging using libthread_db enabled]
>>>>>> [New Thread -1218617216 (LWP 8708)]
>>>>>>
>>>>>> Program received signal SIGSEGV, Segmentation fault.
>>>>>> [Switching to Thread -1218617216 (LWP 8708)]
>>>>>> 0x039ba0d1 in realloc () from /lib/tls/libc.so.6
>>>>>>
>>>>>> I was hoping to tell what request parameter or map configuration
>>>>>> element
>>>>>> might be causing trouble. Can you think of any way for me to pursue
>>>>>> this
>>>>>> at a higher level?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> -- john
>>>>>>
>>>>>>
>>>>>>
>>>>>> Stephen Woodbridge wrote:
>>>>>>
>>>>>>> John,
>>>>>>>
>>>>>>> You can run mapserver cgi at the command line, but you need to
>>>>>>> set up
>>>>>>> the environment variables first, like
>>>>>>>
>>>>>>> export REQUEST_METHOD=GET
>>>>>>> export QUERY_STRING="...."
>>>>>>> gdb mapserv
>>>>>>> run
>>>>>>>
>>>>>>> set your QUERY_STRING appropriately
>>>>>>>
>>>>>>> -Steve W.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>
>>
>>
> --
> Sean Gillies
> sgillies at frii dot com
> http://users.frii.com/sgillies
>
-------------- next part --------------
#
# Start of map file
#
MAP
DEBUG ON
NAME ms4wms
STATUS ON
EXTENT 201621.496941 -294488.285333 1425518.020722 498254.511514
SIZE 600 400
UNITS METERS
SHAPEPATH "data"
IMAGECOLOR 255 255 255
SYMBOLSET "symbols/symbols35.sym"
FONTSET "fonts/fonts.list"
#TEMPLATEPATTERN "example"
IMAGETYPE png24
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
END
OUTPUTFORMAT
NAME png24
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
END
OUTPUTFORMAT
NAME jpeg
DRIVER "GD/JPEG"
MIMETYPE "image/jpeg"
FORMATOPTION "QUALITY=85"
IMAGEMODE RGB
EXTENSION "jpg"
END
#
# Projection definition, consult the PROJ.4 documentation for parameter discussion
#
PROJECTION
"init=epsg:2163"
END
#
# Start of web interface definition (including WMS enabling metadata)
#
WEB
HEADER 'templates/header.html'
TEMPLATE wfs_demo.html
FOOTER 'templates/footer.html'
MINSCALE 1000
MAXSCALE 15000000
IMAGEPATH '/extra/contrib/apache/htdocs/output/'
IMAGEURL '/output/'
METADATA
"wms_title" "UMN MapServer Upper Great Lakes Application"
"wms_abstract" "This is a UMN MapServer application for the upper great lakes states of Michigan, Minnesota, and Wisconsin."
"wms_accessconstraints" "none"
"wms_onlineresource" "http://localhost/cgi-bin/wms_demo.cgi?"
"wms_srs" "EPSG:2163 EPSG:4326 EPSG:26915 EPSG:26916"
END
END
#
# Start of reference map
#
REFERENCE
IMAGE 'images/ugl_ref1.png'
SIZE 155 105
EXTENT 201621.496941 -294488.285333 1425518.020722 498254.511514
STATUS ON
MINBOXSIZE 10
MAXBOXSIZE 150
COLOR -1 -1 -1
OUTLINECOLOR 128 0 0
MARKERSIZE 8
MARKER 'star'
END
#
# Start of legend
#
LEGEND
KEYSIZE 12 12
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
STATUS ON
END
#
# Start of scalebar
#
SCALEBAR
IMAGECOLOR 255 255 255
LABEL
COLOR 0 0 0
SIZE TINY
END
STYLE 1
SIZE 100 2
COLOR 0 0 0
UNITS MILES
INTERVALS 2
TRANSPARENT FALSE
STATUS ON #EMBED
#POSITION LR
END
#
# Start of LAYER DEFINITIONS ---------------------------------------------
LAYER # MODIS raster layer begins here
NAME relief
DATA 'raster/shdrlfi020g_ugl.tif'
STATUS OFF
TYPE RASTER
OFFSITE 169 209 254
DUMP TRUE
METADATA
"wms_title" "UGL Shaded Relief"
"wms_abstract" "Shaded Relief of Michigan, Minnesota, and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
PROJECTION
"init=epsg:4326"
END
CLASS
NAME 'Shaded Relief'
KEYIMAGE 'graphics/relief_keyimage.png'
END
END # MODIS raster layer ends here
LAYER # MODIS raster layer begins here
NAME modis
DATA 'raster/mod09a12003161_ugl_ll_idxa.tif'
STATUS OFF
TYPE RASTER
OFFSITE 70 74 66
METADATA
"wms_title" "UGL 500-meter MODIS 8-day reflectance imagery"
"wms_abstract" "500-meter MODIS 8-day reflectance imagery for Michigan, Minnesota, and Wisconsin. Mosaiced and clipped from MOD09A1 product, scenes h11v04 and h12v04. See http://edcdaac.usgs.gov/modis/mod09.html for more information."
END
PROJECTION
"init=epsg:4326"
END
CLASS
NAME 'MODIS MOD09 Product'
KEYIMAGE 'graphics/modis_keyimage.png'
END
END # MODIS raster layer ends here
LAYER # LandSat WMS map from JPL
NAME landsat
TYPE RASTER
OFFSITE 0 0 0
STATUS OFF
CONNECTIONTYPE WMS
CONNECTION "http://mapus.jpl.nasa.gov/wms.cgi?"
#CONNECTION "http://gisdata.usgs.net/servlet/com.esri.wms.Esrimap?ServiceName=USGS_WMS_LANDSAT7&VERSION=1.0.0&REQUEST=map&Layers=LANDSAT7&SRS=EPSG:4326&REASPECT=false&Format=png&"
#DEBUG ON
METADATA
"wms_srs" "EPSG:4326"
"wms_name" "global_mosaic"
"wms_server_version" "1.1.1"
"wms_format" "image/jpeg"
#"wms_title" "US_LANDSAT7"
#"wms_name" "LANDSAT7"
#"wms_server_version" "1.0.0"
#"wms_format" "image/png"
END
PROJECTION
"init=epsg:4326"
END
# Unfortunately, this layer doesn't render properly when
# the CLASS object is defined. A new bug?
#CLASS
# NAME 'Landsat 7 ETM+'
# KEYIMAGE 'graphics/landsat_keyimage.png'
#END
END # LandSat WMS image ends here
LAYER
NAME cities_poly
GROUP cities
TYPE Polygon
STATUS on
CONNECTIONTYPE WFS
CONNECTION "http://localhost/cgi-bin/wfs_demo.cgi?SERVICE=WFS&VERSION=1.0.0&TYPENAME=cities_poly"
#DATA urban_ugl
HEADER 'templates/cities_header.html'
FOOTER 'templates/cities_footer.html'
TOLERANCE 3
CLASS
NAME 'Urban Areas'
TEMPLATE 'templates/cities_query.html'
COLOR 255 240 115
END # CLASS
DUMP TRUE # allow GML export
METADATA
"wms_title" "UGL Cities"
"wms_abstract" "Urban area polygons for Michigan, Minnesota, and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
#PROJECTION
# "init=epsg:2163"
#END
END # LAYER
LAYER
NAME fedlands
TYPE Polygon
STATUS on
DATA fedlan_ugl
#CONNECTIONTYPE WFS
#CONNECTION "http://localhost/cgi-bin/wfs_demo.cgi?SERVICE=WFS&VERSION=1.0.0&TYPENAME=fedlands"
TOLERANCE 3
CLASS
NAME 'Federal Land'
TEMPLATE 'templates/fedland_query.html'
COLOR 164 96 89
OUTLINECOLOR 144 72 64
END # CLASS
DUMP TRUE # allow GML export
METADATA
"wms_title" "UGL Federal Land"
"wms_abstract" "Federal land polygons for Michigan, Minnesota, and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
PROJECTION
"init=epsg:4326"
END
END # LAYER
LAYER # Hydrography layer begins here
NAME hydro
TYPE POLYGON
STATUS ON
#DATA hydrop_ugl
CONNECTIONTYPE WFS
CONNECTION "http://localhost/cgi-bin/wfs_demo.cgi?SERVICE=WFS&VERSION=1.0.0&TYPENAME=hydro"
METADATA
"wms_title" "UGL Hydrography"
"wms_abstract" "Hydrography polygons for Michigan, Minnesota, and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
PROJECTION
"init=epsg:2163"
END
TOLERANCE 3
CLASSITEM 'FEATURE'
CLASS
NAME 'Lakes'
EXPRESSION /(^B|^C|^L|^R)./
TEMPLATE 'templates/hydro_query.html'
COLOR 72 64 254
END # CLASS
CLASS
NAME 'Rivers'
EXPRESSION 'Stream'
TEMPLATE 'templates/hydro_query.html'
COLOR 136 128 255
END # CLASS
CLASS
NAME 'Wetlands'
EXPRESSION 'Swamp or Marsh'
TEMPLATE 'templates/hydro_query.html'
COLOR 195 252 255
OUTLINECOLOR 195 252 255
SYMBOL 'circle'
SIZE 0
END # CLASS
DUMP TRUE # allow GML export
END # LAYER
LAYER # County lines
NAME counties
TYPE LINE
STATUS ON
CONNECTIONTYPE WFS
CONNECTION "http://localhost/cgi-bin/wfs_demo.cgi?SERVICE=WFS&VERSION=1.0.0&TYPENAME=counties"
#DATA co2000_ugl
CLASSITEM 'COUNTY'
CLASS
NAME 'County Boundary'
EXPRESSION /./
COLOR 201 201 201
END # CLASS
PROJECTION
"init=epsg:2163"
END
METADATA
"wms_title" "UGL County Boundaries"
"wms_abstract" "County boundary lines for Michigan, Minnesota and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
END # County lines end here
LAYER # ROADS LAYER
NAME cty_roads
GROUP roads
TYPE LINE
STATUS OFF
DATA roads_ugl
MAXSCALE 750000
METADATA
"wms_title" "UGL County Roads"
"wms_abstract" "County road lines for Michigan, Minnesota and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
PROJECTION
"init=epsg:4326"
END
TOLERANCE 5
CLASSITEM 'CLASS1'
CLASS
NAME 'Minor Arterial Roads'
EXPRESSION '3'
TEMPLATE 'templates/roads_query.html'
COLOR 165 165 165
END # CLASS
CLASS
EXPRESSION '4'
COLOR 210 210 210
END # CLASS
DUMP TRUE # allow GML export
END # ROADS LAYER
LAYER # state highways begin here
NAME state_hwy
GROUP roads
MAXSCALE 1500000
STATUS OFF
DATA roads_ugl
TYPE LINE
FILTERITEM 'CLASS1'
FILTER '2'
TOLERANCE 5
CLASS
NAME 'Principal Arterial Roads'
TEMPLATE 'templates/roads_query.html'
STYLE
COLOR 255 0 0
SIZE 1
SYMBOL 'circle'
END
END
DUMP TRUE # allow GML export
PROJECTION
"init=epsg:4326"
END
METADATA
"wms_title" "UGL Highways"
"wms_abstract" "Highway lines for Michigan, Minnesota and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
END # highways
LAYER # interstate highways begin here
NAME interstate
GROUP roads
# MAXSCALE 22500000
STATUS OFF
#DATA roads_ugl
CONNECTIONTYPE WFS
CONNECTION "http://localhost/cgi-bin/wfs_demo.cgi?SERVICE=WFS&VERSION=1.0.0&TYPENAME=interstate"
TYPE LINE
FILTERITEM 'CLASS1'
FILTER '1'
TOLERANCE 5
CLASS
NAME "Interstate Hwy."
TEMPLATE 'templates/roads_query.html'
STYLE
COLOR 128 0 0
# SIZE 2
# SYMBOL 'circle'
END
END
DUMP TRUE # allow GML export
PROJECTION
"init=epsg:2163"
END
METADATA
"wms_title" "UGL Highways"
"wms_abstract" "Interstate highway lines for Michigan, Minnesota and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
END # highways
LAYER # States line layer begins here
NAME states_bnd
GROUP states
CONNECTIONTYPE WFS
CONNECTION "http://localhost/cgi-bin/wfs_demo.cgi?SERVICE=WFS&VERSION=1.0.0&TYPENAME=states"
#DATA states_ugl
STATUS ON
TYPE LINE
CLASSITEM "CLASS"
CLASS
EXPRESSION 'land'
SYMBOL 'circle'
COLOR 64 64 64
SIZE 1
END
PROJECTION
"init=epsg:2163"
END
METADATA
"wms_title" "Upper Great Lakes State Boundaries"
"wms_abstract" "State boundary lines for Michigan, Minnesota and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
END # States line layer ends here
LAYER
NAME roads_anno
GROUP roads
MAXSCALE 750000
STATUS OFF
DATA roads_ugl
TYPE ANNOTATION
LABELITEM "SIGN"
CLASSITEM "CLASS1"
CLASS
EXPRESSION "3"
STYLE
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/sthwy.png'
END
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 0 0 0
END
END
CLASS
EXPRESSION "2"
STYLE
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/ushwy.png'
END
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 0 0 0
END
END
PROJECTION
"init=epsg:4326"
END
METADATA
"wfs_title" "UGL Highways"
"wms_abstract" "Highway annotations for Michigan, Minnesota and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
END # highway annotation
LAYER
NAME roads_anno1
GROUP roads
STATUS OFF
DATA roads_ugl
TYPE ANNOTATION
LABELITEM "SIGN"
CLASSITEM "CLASS1"
CLASS
EXPRESSION "1"
STYLE
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/interstate.png'
END
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 255 255 255
END
END
PROJECTION
"init=epsg:4326"
END
METADATA
"wms_title" "UGL Highways"
"wms_abstract" "Interstate highway annotations for Michigan, Minnesota and Wisconsin. Clipped from National Atlas data (http://www.nationalatlas.gov)."
END
END
LAYER # Cities label layer begins here
NAME cities_label
GROUP cities
DATA urban_ugl
STATUS ON
TYPE ANNOTATION
MAXSCALE 750000
PROJECTION
"init=epsg:4326"
END
LABELITEM "NAME"
CLASS
COLOR -1 -1 -1
LABEL
COLOR 32 32 128
TYPE TRUETYPE
FONT arial-bold
SIZE 8
ANTIALIAS TRUE
POSITION CC
PARTIALS FALSE
MINDISTANCE 300
BUFFER 2
END # end of label
END # end of class
END # Cities label layer ends here
LAYER # States label layer begins here
NAME states_label
GROUP states
DATA states_ugl
STATUS ON
TYPE ANNOTATION
PROJECTION
"init=epsg:4326"
END
CLASSITEM 'CLASS'
LABELITEM 'STATE'
CLASS
EXPRESSION 'land'
COLOR -1 -1 -1
LABEL
COLOR 132 31 31
SHADOWCOLOR 218 218 218
SHADOWSIZE 2 2
TYPE TRUETYPE
FONT arial-bold
SIZE 12
ANTIALIAS FALSE
POSITION CL
PARTIALS FALSE
MINDISTANCE 300
BUFFER 4
END # end of label
END # end of class
END # States label layer ends here
# End of LAYER DEFINITIONS -------------------------------
END # Map File
More information about the mapserver-users
mailing list