[mapserver-users] mapserver 5.0.2 segv using AGG
woodbri at swoodbridge.com
Wed Apr 16 15:20:07 EDT 2008
Moving this to the dev list ...
As a follow up to this it is reproducible on the current nightly tarball
So in mapgd.c lines 3595+ are:
/* It seems there is a bug in gd 2.0.33 and earlier that leaves the
colors open flag set to one. */
for( i = 0; i < gdPImg->colorsTotal; i++ )
gdPImg->open[i] = 0;
gdImagePngCtx( gdPImg, ctx );
gdImageDestroy( gdPImg );
It looks like the call to gdImageCreatePaletteFromTrueColor() is
returning NULL and mapserver is not checking and dealing with this
condition and passing gdPImg as a NULL pointer to gdImagePngCtx( gdPImg,
ctx ); which is causing a SEGV when it is accessed.
Running with packages on Debian Etch:
libgd2-noxpm/stable uptodate 2.0.33-5.2
libgd2-noxpm-dev/stable uptodate 2.0.33-5.2
I also ran into this same problem in brief experience with Fedora 8.
Stephen Woodbridge wrote:
> Hi all,
> Is this a known problem? I did could not find a ticket for it. I'm
> trying the nightly build next.
> woodbri at maps:/u/woodbri/work/mapserver-5.0.2$ gdb mapserv
> GNU gdb 6.4.90-debian
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> welcome to change it and/or distribute copies of it under certain
> 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-gnu"...Using host libthread_db
> library "/lib/libthread_db.so.1".
> (gdb) run
> > a
> Starting program: /u/woodbri/work/mapserver-5.0.2/mapserv
> > a
> [Thread debugging using libthread_db enabled]
> [New Thread 47982973225104 (LWP 20007)]
> warning: Lowest section in /usr/lib/libicudata.so.36 is .hash at
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 47982973225104 (LWP 20007)]
> 0x00002ba3e360e733 in gdImagePngCtxEx () from /usr/lib/libgd.so.2
> (gdb) where
> #0 0x00002ba3e360e733 in gdImagePngCtxEx () from /usr/lib/libgd.so.2
> #1 0x0000000000453bb3 in msSaveImageGDCtx (img=0x738040, ctx=0x6c1a90,
> format=0x6247a0) at mapgd.c:3602
> #2 0x0000000000453d3e in msSaveImageGD (img=0x738040,
> filename=<value optimized out>, format=0x6247a0) at mapgd.c:3543
> #3 0x0000000000454886 in msSaveImageAGG (img=0x738040, filename=0x0,
> format=0x6247a0) at mapagg.cpp:2194
> #4 0x0000000000428f5b in msSaveImage (map=0x61d560, img=0x738000,
> filename=0x0) at maputil.c:604
> #5 0x000000000040e8d4 in main (argc=<value optimized out>,
> argv=<value optimized out>) at mapserv.c:1580
> (gdb) q
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
More information about the mapserver-users