WMS Problem - SEGV in drawPNG()

Dirk Tilger dirk at ADVTECHME.COM
Fri Dec 8 06:26:58 EST 2006


On Tue, Nov 28, 2006 at 12:11:42AM -0500, Stephen Woodbridge wrote:
> 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)

A lot of PNG related SEGV in have been bugs in too old version of libpng
in the past for myself. If you're not using the latest, I'd try this one
first.

Dirk Tilger



More information about the mapserver-dev mailing list