Segmentation fault: PHP Mapscript related?

BC Rocks bcrocks at GMAIL.COM
Tue Apr 12 17:17:49 PDT 2005


Hello,

I have successfully compiled mapserver, but the compiled executable
segfaults whenever called.  Here is the scoop:

Packages:
Mapserver 4.4.2
PHP 5.0.5
gd-2.0.33
gdal-1.2.6
geos-2.1.1
tiff-3.7.2
postgis-0.9.1
proj-4.4.9
postgresql-8.0.1

PHP was configured as follows (as I am successfully using on another box):
./configure --build=i686-mandrake-linux-gnu --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var/lib
--sharedstatedir=/usr/com --mandir=/usr/share/man
--infodir=/usr/share/info --enable-discard-path
--enable-force-cgi-redirect --enable-shared --disable-static
--disable-debug --disable-rpath --enable-pic
--enable-inline-optimization --enable-memory-limit
--with-config-file-path=/etc --with-config-file-scan-dir=/etc/php
--with-pear=/usr/share/pear --enable-magic-quotes --enable-debugger
--enable-track-vars --with-exec-dir=/usr/bin --with-versioning
--with-mod_charset --with-regex=php --enable-track-vars
--enable-trans-sid --enable-safe-mode --enable-ctype --enable-ftp
--with-gettext=/usr --enable-posix --enable-session --enable-sysvsem
--enable-sysvshm --enable-yp --with-openssl=/usr --without-kerberos
--with-ttf --with-freetype-dir=/usr/include/freetype2 --with-zlib=/usr
--with-zlib=/usr --with-zlib-dir=/usr --with-pear --with-jpeg-dir=/usr
--with-png-dir=/usr --with-gd --enable-gd-native-ttf
--with-pgsql=/var/lib/pgsql/ --without-iodbc --without-custom-odbc
--without-unixODBC --without-dbmaker --enable-soap
--with-xml=/usr/include/libxml2/libxml --with-apxs2=/usr/sbin/apxs2
--with-mcrypt=/usr/local/lib --with-curl=/usr/local/include

Mapserver configure parameters are as follows:
./configure --with-php=/usr/include/php
--with-php-regex-dir=/usr/src/php/php-5.0.4/regex --with-jpeg=/usr/lib
--with-png=/usr/lib --with-freetype=/usr/bin/freetype-config
--with-proj --with-gd --without-pdf
--with-geos=/usr/local/bin/geos-config --with-gdal
--with-postgis=/var/lib/pgsql/bin/pg_config --without-tiff
--with-wmsclient --with-wfsclient --with-wcs
--with-curl-config=/usr/bin --with-ogr --with-httpd=/usr/sbin/httpd2

After editing the Makefile (it included an empty -I flag with regard
to the GEOS include path), I can successfully compile.  When I remove
the --with-php=/usr/include/php
--with-php-regex-dir=/usr/src/php/php-5.0.4/regex parameters, I
compile a mapserv executable capable of rendering PNG using shp2img. 
As mentioned above, when I include the mapscript build, the executable
segfaults.  I have been pulling my hair out for a couple days on this
one (using 4.4.1).  Any thoughts?

I know the mapfile and perms, etc are correct as I can render images
without the inclusion of mapscript.  I read some threads with regard
to GDAL and JPG/TIFF issues (I did try using the internal GDAL libs),
but I don't think that is the issue...especially since if I pull the
php, things compile.  Could their be conflicts between my php compile
and one of the other packages?


Here is the gdb info, if that helps provide insight:

gdb /var/www/cgi-bin/mapserv
GNU gdb 6.2-2mdk (Mandrakelinux)
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 "i586-mandrake-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run "QUERY_STRING=layer=lakespy2&layer=dlgstln2&zoomsize=2&map=%2Fvar%2Fwww%2Fhtml%2Fdemo%2Fworkshop%2Fitasca.map&program=%2Fcgi-bin%2Fmapserv&root=demo%2Fworkshop&map_web_imagepath=%2Fvar%2Fwww%2Fhtml%2Ftmp%2F&map_web_imageurl=%2Ftmp%2F&map_web_template=itasca_basic.html"
Starting program: /var/www/cgi-bin/mapserv
"QUERY_STRING=layer=lakespy2&layer=dlgstln2&zoomsize=2&map=%2Fvar%2Fwww%2Fhtml%2Fdemo%2Fworkshop%2Fitasca.map&program=%2Fcgi-bin%2Fmapserv&root=demo%2Fworkshop&map_web_imagepath=%2Fvar%2Fwww%2Fhtml%2Ftmp%2F&map_web_imageurl=%2Ftmp%2F&map_web_template=itasca_basic.html"

Program received signal SIGSEGV, Segmentation fault.
0x4073e971 in vfprintf () from /lib/tls/libc.so.6
(gdb) backtrace
#0  0x4073e971 in vfprintf () from /lib/tls/libc.so.6
#1  0x40747560 in printf () from /lib/tls/libc.so.6
#2  0x0804da85 in writeError ()
#3  0x0804e18c in loadMap ()
#4  0x08050804 in main ()


Thanks in advance,
BC



More information about the MapServer-users mailing list