WMS Problem - SEGV in drawPNG()

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Nov 28 00:11:42 EST 2006


Hi,

This is the same problem I have been having with the WMS Layer. After 
mangling the user agent string to by pass the mapserver block, I 
exchanged email with Lucian Plesea and have details on the block but 
that is of topic.

I ran shp2img in gdb and got the following:

woodbri at carto:/u/software/mapserver-4.10.0$ gdb ./shp2img
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-linux"...Using host libthread_db 
library "/lib/libthread_db.so.1".

(gdb) run  -m /u/data/maps/wmstest.map  -o junk.png
Starting program: /u/software/mapserver-4.10.0/shp2img -m 
/u/data/maps/wmstest.map  -o junk.png
[Thread debugging using libthread_db enabled]
[New Thread 46912535914224 (LWP 3626)]
[Mon Nov 27 23:59:46 2006].437630 HTTP: Starting to prepare HTTP requests.
[Mon Nov 27 23:59:46 2006].437790 HTTP request: id=0, 
http://wms.jpl.nasa.gov/wms.cgi?STYLES=&LAYERS=modis%2Cglobal%5Fmosaic&REQUEST=GetMap&SERVICE=WMS&FORMAT=image%2Fpng&HEIGHT=250&VERSION=1.1.1&SRS=EPSG:4326&WIDTH=400&BBOX=%2D180%2C%2D112%2E5%2C180%2C112%2E5&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage
[Mon Nov 27 23:59:46 2006].438019 HTTP: Before download loop
[Mon Nov 27 23:59:48 2006].751270 msHTTPWriteFct(id=0, 1287 bytes)
[Mon Nov 27 23:59:48 2006].900383 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:48 2006].917868 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].48796 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].66150 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].83888 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].102002 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].196692 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].215055 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].232294 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].250283 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].267524 msHTTPWriteFct(id=0, 617 bytes)
[Mon Nov 27 23:59:49 2006].267546 msHTTPWriteFct(id=0, 823 bytes)
[Mon Nov 27 23:59:49 2006].285012 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].302876 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].320864 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].342975 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].360963 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].378327 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].395817 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].413056 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].430794 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].448908 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].466270 msHTTPWriteFct(id=0, 1081 bytes)
[Mon Nov 27 23:59:49 2006].466292 msHTTPWriteFct(id=0, 359 bytes)
[Mon Nov 27 23:59:49 2006].484145 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].501997 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].519989 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].537351 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].554715 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].572203 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:49 2006].856276 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:50 2006].461273 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:51 2006].65399 msHTTPWriteFct(id=0, 4441 bytes)
[Mon Nov 27 23:59:51 2006].65509 msHTTPWriteFct(id=0, 1343 bytes)
[Mon Nov 27 23:59:51 2006].404053 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:51 2006].688252 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:52 2006].387441 msHTTPWriteFct(id=0, 5792 bytes)
[Mon Nov 27 23:59:52 2006].538465 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:52 2006].556954 msHTTPWriteFct(id=0, 1448 bytes)
[Mon Nov 27 23:59:52 2006].690008 msHTTPWriteFct(id=0, 3457 bytes)
[Mon Nov 27 23:59:52 2006].690038 msHTTPWriteFct(id=0, 3775 bytes)
[Mon Nov 27 23:59:52 2006].843901 msHTTPWriteFct(id=0, 4344 bytes)
[Mon Nov 27 23:59:52 2006].861521 msHTTPWriteFct(id=0, 4344 bytes)
[Mon Nov 27 23:59:52 2006].992077 msHTTPWriteFct(id=0, 16384 bytes)
[Mon Nov 27 23:59:52 2006].992266 msHTTPWriteFct(id=0, 10057 bytes)
[Mon Nov 27 23:59:53 2006].92155 HTTP: After download loop
[Mon Nov 27 23:59:53 2006].92186 msHTTPExecuteRequests() timing summary 
per layer (connect_time + time_to_first_packet + download_time = 
total_time in seconds)
[Mon Nov 27 23:59:53 2006].92274 Layer 0: 0.151 + 2.162 + 4.492 = 6.805s
[Mon Nov 27 23:59:53 2006].92453 msDrawRasterLayerLow(global_landsat): 
entering.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912535914224 (LWP 3626)]
0x00000000004550ef in drawPNG (map=0x5a0250, layer=0x2aaaaaac0010,
     img=0x5f55b0, filename=0x611730 "/tmp/ms_tmp/456bc242_e2a_0.img.tmp")
     at mapraster.c:865
865               vv = png->pixels[(y == -0.5)?0:MS_NINT(y)][(x == 
-0.5)?0:MS_NINT(x)];
(gdb) p png
$1 = 0x616ed0
(gdb) p *png
$2 = {pixels = 0x0, sx = 400, sy = 250, colorsTotal = 0, red = {
     0 <repeats 256 times>}, green = {0 <repeats 256 times>}, blue = {
     0 <repeats 256 times>}, open = {0 <repeats 256 times>}, transparent 
= -1,
   polyInts = 0x0, polyAllocated = 0, brush = 0x0, tile = 0x0, 
brushColorMap = {
     0 <repeats 256 times>}, tileColorMap = {0 <repeats 256 times>},
   styleLength = 0, stylePos = 0, style = 0x0, interlace = 0, thick = 1,
   alpha = {0 <repeats 256 times>}, trueColor = 1, tpixels = 0x618b60,
   alphaBlendingFlag = 1, saveAlphaFlag = 0, AA = 0, AA_color = 0,
   AA_dont_blend = 0, cx1 = 0, cy1 = 0, cx2 = 399, cy2 = 249}
(gdb) l
860       for(i=0; i<img->sy; i++) { /* for each row */
861         if((y >= -0.5) && (y < h)) {
862           x = startx;
863           for(j=0; j<img->sx; j++) {
864             if((x >= -0.5) && (x < w)) {
865               vv = png->pixels[(y == -0.5)?0:MS_NINT(y)][(x == 
-0.5)?0:MS_NINT(x)];
866               if(cmap[vv] != -1)
867                 img->pixels[i][j] = cmap[vv];
868             }
869             x+=skipx;
(gdb)
(gdb) where
#0  0x00000000004550ef in drawPNG (map=0x5a0250, layer=0x2aaaaaac0010,
     img=0x5f55b0, filename=0x611730 "/tmp/ms_tmp/456bc242_e2a_0.img.tmp")
     at mapraster.c:865
#1  0x0000000000456a8f in msDrawRasterLayerLow (map=0x5a0250,
     layer=0x2aaaaaac0010, image=0x7fffff867d30) at mapraster.c:1524
#2  0x00000000004217af in msDrawRasterLayer (map=0x0, layer=0x612960,
     image=0x0) at mapdraw.c:1255
#3  0x0000000000420991 in msDrawLayer (map=0x5a0250, layer=0x2aaaaaac0010,
     image=0x5f5570) at mapdraw.c:869
#4  0x0000000000462f1a in msDrawWMSLayerLow (nLayerId=0,
     pasReqInfo=0x7fffff8692f0, numRequests=6367584, map=0x5a0250,
     lp=0x2aaaaaac0010, img=0x5f5570) at mapwmslayer.c:1197
#5  0x0000000000420291 in msDrawMap (map=0x5a0250) at mapdraw.c:488
#6  0x0000000000407d2c in main (argc=5, argv=0x7fffff86ffa8) at 
shp2img.c:231
(gdb)


The mapfile is:

MAP
   NAME "wms-jpl"
   STATUS ON
   EXTENT -180.0 -90.0 180.0 90.0
   SIZE 400 250
   IMAGECOLOR 200 200 200
   IMAGETYPE png
   UNITS DD
   #DEBUG ON
   PROJECTION
     "init=epsg:4326"
   END

   WEB
     IMAGEPATH "/tmp/ms_tmp/"
     IMAGEURL "/ms_tmp/"
   END

   LAYER
     NAME "global_landsat"
     TYPE RASTER
     DEBUG TRUE
     STATUS DEFAULT
     MINSCALE 20000
     CONNECTIONTYPE WMS
     CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?STYLES="

     # following does not pick up the wms_styles
     #    CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?"

     METADATA
       "wms_srs"            "EPSG:4326"
       "wms_name"           "modis,global_mosaic"
#      "wms_name"           "global_mosaic"
#      "wms_styles"         ""
       "wms_server_version" "1.1.1"
#      "wms_format"         "image/jpeg"
       "wms_format"         "image/png"
#      "wms_format"         "image/geotiff"
#      "wms_format"         "image/tiff"
     END
   END

END



More information about the mapserver-dev mailing list