[Mapserver-users] httpd-error.log: Incompatible libpng version

Jason Thaxter thaxter at gomoos.org
Tue Dec 30 14:32:15 EST 2003


The FreeBSD port of gdal does, by default, do "--with-png=internal", which
will definitely cause problems; it appeared to compile against the internal
version, but link against the system version, which is almost certainly a much
higher version, e.g. 1.2.5.

I had luck with changing the port makefile (/usr/ports/graphics/gdal/Makefile)
to do this instead:

	--with-png=/usr/local

(and --with-zlib=/usr is probably a good idea as well).

Doing this, however, appears to leave gdal (via Perl mapscript) incapable of
using PNG raster layers - it just crashes silently. I tried to analyze this
with gdb; but then it wouldn't crash. Most irritatingly, it would not crash on
one running instance of httpd, but always crash on all others. I never got to
the bottom of it.

Having tried many different compile combinations and package versions (and
given that I'm currently working on Mapserver 3.6.6 and GDAL version 1.1.8),
I'd have to say that the best solution really is to compile gdal with the
system libpng and convert PNG raster layers to TIFF or something else if they
are causing crashes.

Jason Thaxter

On Sun, Dec 28, 2003 at 05:20:42PM +0100, thelen at ccgis.de wrote:
> 
> 
> Thanks Norman, thanks Daniel!!
> 
> Both ways are working properly. I understand Daniels way, because gdal
> comes with its own copy of libpng (--with-png=internal). But I do not
[snip]
> >> So, it is a gdal (and/or a FreeBSD Ports) problem! Isn't "application"
> >> then in this case gdal??
> >>
> >>
> >> What can I do then?
> >
> > You need to force GDAL to use the system version of libpng. GDAL has the
> > following configure option:
> >
> >    --with-png[=ARG]        Include PNG support (ARG=internal, no or path)
> >
> >
> > So you should add "--with-png=/usr/local" to your GDAL configure options
> > and rebuild.

This works.  It shouldn't be dependent on FreeBSD version, but on the age
of your ports tree - unless zlib is somehow implicated!

> >
> >
> >> And why does this error not occur with MapServer 3.6.6?
> >>
> >
> > Probably just a coincidence related to the order in which symbols are
> > loaded. You definitely have two copies of libpng loaded in memory at
> > once in both cases (i.e. in 3.6 and inb 4.0), but in one case the
> > problem happens and in the other you're lucky enough that the program
> > always uses the right symbols and doesn't produce the error.

I had  


-- 
----------------------------------------------
Jason Thaxter
GoMOOS, P.O. Box 4919, Portland, ME 04112-4919
Office Location: 1 Canal Plaza, 7th Floor
Office: 207.773.0423
Fax:    207.773.8672
Email:  thaxter at gomoos.org
------------www.gomoos.org--------------------



More information about the mapserver-users mailing list