Hello,
I hope this is the right list for my issue. I have a problem with PHP on
FreeBSD and Mapscript (the graphics/mapserver package). I suppose the
problem is in conjunction with the combination of lang/php5 (PHP 5.4.6)
and Mapserver 6.0.3. Everytime I try to initiate a new mapObj in
mapscript, PHP segfaults.
My testscript:
<?php
echo ms_GetVersion();
$map = new mapObj('test.map');
?>
ms_GetVersion() still works, but the next line ($map = new
mapObj('test.map')) causes the segmentation fault to happen:
brfr@frodo> php -f pi.php
MapServer version 6.0.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=GEOS INPUT=POSTGIS INPUT=OGR INPUT=GDAL
INPUT=SHAPEFILESegmentation fault (core dumped)
An examination of the core with gdb yields:
brfr@frodo> gdb /usr/local/bin/php php.core
GNU gdb 6.1.1 [FreeBSD]
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 "amd64-marcel-freebsd"...
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.5...done.
Loaded symbols for /lib/libcrypt.so.5
Reading symbols from /usr/local/lib/libpcre.so.1...done.
Loaded symbols for /usr/local/lib/libpcre.so.1
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libxml2.so.5...done.
Loaded symbols for /usr/local/lib/libxml2.so.5
Reading symbols from /lib/libz.so.6...done.
Loaded symbols for /lib/libz.so.6
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from
/usr/local/lib/php/20100525-debug/php_mapscript.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/php_mapscript.so
Reading symbols from /usr/local/lib/libcurl.so.6...done.
Loaded symbols for /usr/local/lib/libcurl.so.6
Reading symbols from /usr/lib/libssl.so.6...done.
Loaded symbols for /usr/lib/libssl.so.6
Reading symbols from /lib/libcrypto.so.6...done.
Loaded symbols for /lib/libcrypto.so.6
Reading symbols from /usr/local/lib/libpq.so.5...done.
Loaded symbols for /usr/local/lib/libpq.so.5
Reading symbols from /usr/local/lib/libgdal.so.17...done.
Loaded symbols for /usr/local/lib/libgdal.so.17
Reading symbols from /usr/local/lib/libgeos_c.so.8...done.
Loaded symbols for /usr/local/lib/libgeos_c.so.8
Reading symbols from /usr/local/lib/libproj.so.7...done.
Loaded symbols for /usr/local/lib/libproj.so.7
Reading symbols from /usr/local/lib/libexpat.so.6...done.
Loaded symbols for /usr/local/lib/libexpat.so.6
Reading symbols from /usr/local/lib/libgd.so.4...done.
Loaded symbols for /usr/local/lib/libgd.so.4
Reading symbols from /usr/local/lib/libjpeg.so.11...done.
Loaded symbols for /usr/local/lib/libjpeg.so.11
Reading symbols from /usr/local/lib/libfreetype.so.9...done.
Loaded symbols for /usr/local/lib/libfreetype.so.9
Reading symbols from /usr/lib/libbz2.so.4...done.
Loaded symbols for /usr/lib/libbz2.so.4
Reading symbols from /usr/local/lib/libpng15.so.15...done.
Loaded symbols for /usr/local/lib/libpng15.so.15
Reading symbols from /usr/local/lib/libXpm.so.4...done.
Loaded symbols for /usr/local/lib/libXpm.so.4
Reading symbols from /usr/local/lib/libX11.so.6...done.
Loaded symbols for /usr/local/lib/libX11.so.6
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libthr.so.3...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /usr/local/lib/libintl.so.9...done.
Loaded symbols for /usr/local/lib/libintl.so.9
Reading symbols from /usr/local/lib/libgeos-3.3.3.so...done.
Loaded symbols for /usr/local/lib/libgeos-3.3.3.so
Reading symbols from /usr/local/lib/libsqlite3.so.8...done.
Loaded symbols for /usr/local/lib/libsqlite3.so.8
Reading symbols from /usr/local/lib/libxerces-c-3.1.so...done.
Loaded symbols for /usr/local/lib/libxerces-c-3.1.so
Reading symbols from /usr/local/lib/libNCSEcw.so.0...done.
Loaded symbols for /usr/local/lib/libNCSEcw.so.0
Reading symbols from /usr/local/lib/libNCSEcwC.so.0...done.
Loaded symbols for /usr/local/lib/libNCSEcwC.so.0
Reading symbols from /usr/local/lib/libNCSCnet.so.0...done.
Loaded symbols for /usr/local/lib/libNCSCnet.so.0
Reading symbols from /usr/local/lib/libNCSUtil.so.0...done.
Loaded symbols for /usr/local/lib/libNCSUtil.so.0
Reading symbols from /usr/local/lib/libjasper.so.4...done.
Loaded symbols for /usr/local/lib/libjasper.so.4
Reading symbols from /usr/local/lib/libgif.so.5...done.
Loaded symbols for /usr/local/lib/libgif.so.5
Reading symbols from /usr/local/lib/libSM.so.6...done.
Loaded symbols for /usr/local/lib/libSM.so.6
Reading symbols from /usr/local/lib/libICE.so.6...done.
Loaded symbols for /usr/local/lib/libICE.so.6
Reading symbols from /usr/local/lib/libxcb.so.2...done.
Loaded symbols for /usr/local/lib/libxcb.so.2
Reading symbols from /usr/local/lib/libXau.so.6...done.
Loaded symbols for /usr/local/lib/libXau.so.6
Reading symbols from /usr/local/lib/libXdmcp.so.6...done.
Loaded symbols for /usr/local/lib/libXdmcp.so.6
Reading symbols from /usr/local/lib/libpthread-stubs.so.0...done.
Loaded symbols for /usr/local/lib/libpthread-stubs.so.0
Reading symbols from /usr/lib/librpcsvc.so.5...done.
Loaded symbols for /usr/lib/librpcsvc.so.5
Reading symbols from /usr/local/lib/libgeotiff.so.3...done.
Loaded symbols for /usr/local/lib/libgeotiff.so.3
Reading symbols from /usr/local/lib/libtiff.so.4...done.
Loaded symbols for /usr/local/lib/libtiff.so.4
Reading symbols from /usr/local/lib/libjbig.so.1...done.
Loaded symbols for /usr/local/lib/libjbig.so.1
Reading symbols from /usr/lib/liblzma.so.5...done.
Loaded symbols for /usr/lib/liblzma.so.5
Reading symbols from /usr/lib/librt.so.1...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/local/lib/php/20100525-debug/hash.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/hash.so
Reading symbols from /usr/local/lib/php/20100525-debug/iconv.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/iconv.so
Reading symbols from /usr/local/lib/php/20100525-debug/pgsql.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/pgsql.so
Reading symbols from /usr/local/lib/php/20100525-debug/phar.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/phar.so
Reading symbols from /usr/local/lib/php/20100525-debug/zlib.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/zlib.so
Reading symbols from /usr/local/lib/php/20100525-debug/pdo.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/pdo.so
Reading symbols from /usr/local/lib/php/20100525-debug/mcrypt.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/mcrypt.so
Reading symbols from /usr/local/lib/libmcrypt.so.8...done.
Loaded symbols for /usr/local/lib/libmcrypt.so.8
Reading symbols from /usr/local/lib/libltdl.so.7...done.
Loaded symbols for /usr/local/lib/libltdl.so.7
Reading symbols from /usr/local/lib/php/20100525-debug/xml.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/xml.so
Reading symbols from /usr/local/lib/php/20100525-debug/dom.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/dom.so
Reading symbols from /usr/local/lib/php/20100525-debug/xmlreader.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/xmlreader.so
Reading symbols from /usr/local/lib/php/20100525-debug/xmlwriter.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/xmlwriter.so
Reading symbols from /usr/local/lib/php/20100525-debug/session.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/session.so
Reading symbols from /usr/local/lib/php/20100525-debug/bz2.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/bz2.so
Reading symbols from /usr/local/lib/php/20100525-debug/zip.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/zip.so
Reading symbols from /usr/local/lib/php/20100525-debug/mbstring.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/mbstring.so
Reading symbols from /usr/local/lib/libonig.so.1...done.
Loaded symbols for /usr/local/lib/libonig.so.1
Reading symbols from /usr/local/lib/php/20100525-debug/pdo_pgsql.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/pdo_pgsql.so
Reading symbols from /usr/local/lib/php/20100525-debug/pdo_sqlite.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/pdo_sqlite.so
Reading symbols from /usr/local/lib/php/20100525-debug/gettext.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/gettext.so
Reading symbols from /usr/local/lib/php/20100525-debug/json.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/json.so
Reading symbols from /usr/local/lib/php/20100525-debug/tokenizer.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/tokenizer.so
Reading symbols from /usr/local/lib/php/20100525-debug/curl.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/curl.so
Reading symbols from /usr/local/lib/php/20100525-debug/gd.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/gd.so
Reading symbols from /usr/local/lib/libt1.so.5...done.
Loaded symbols for /usr/local/lib/libt1.so.5
Reading symbols from /usr/local/lib/php/20100525-debug/imap.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/imap.so
Reading symbols from /usr/local/lib/libc-client4.so.9...done.
Loaded symbols for /usr/local/lib/libc-client4.so.9
Reading symbols from /usr/lib/libpam.so.5...done.
Loaded symbols for /usr/lib/libpam.so.5
Reading symbols from /usr/local/lib/php/20100525-debug/filter.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/filter.so
Reading symbols from /usr/local/lib/php/20100525-debug/openssl.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/openssl.so
Reading symbols from /usr/local/lib/php/20100525-debug/posix.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/posix.so
Reading symbols from /usr/local/lib/php/20100525-debug/ctype.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/ctype.so
Reading symbols from /usr/local/lib/php/20100525-debug/simplexml.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/simplexml.so
Reading symbols from /usr/local/lib/php/20100525-debug/tidy.so...done.
Loaded symbols for /usr/local/lib/php/20100525-debug/tidy.so
Reading symbols from /usr/local/lib/libtidy-0.99.so.0...done.
Loaded symbols for /usr/local/lib/libtidy-0.99.so.0
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x000000000069a10a in zend_std_get_constructor (object=0x802066258)
at /usr/ports/lang/php5/work/php-5.4.6/Zend/zend_object_handlers.c:1271
1271 /usr/ports/lang/php5/work/php-5.4.6/Zend/zend_object_handlers.c: No
such file or directory.
in /usr/ports/lang/php5/work/php-5.4.6/Zend/zend_object_handlers.c
[New Thread 80217b400 (LWP 120133/php)]
The full backtrace:
(gdb) bt
#0 0x000000000069a10a in zend_std_get_constructor (object=0x802066258)
at /usr/ports/lang/php5/work/php-5.4.6/Zend/zend_object_handlers.c:1271
#1 0x00000000006a406f in ZEND_NEW_SPEC_HANDLER
(execute_data=0x8020310d8) at zend_vm_execute.h:816
#2 0x00000000006a0db1 in execute (op_array=0x8020670b0) at
zend_vm_execute.h:410
#3 0x00000000006627b9 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /usr/ports/lang/php5/work/php-5.4.6/Zend/zend.c:1289
#4 0x00000000005caa86 in php_execute_script (primary_file=0x7fffffffd7f0)
at /usr/ports/lang/php5/work/php-5.4.6/main/main.c:2473
#5 0x00000000007ba2c4 in do_cli (argc=3, argv=0x7fffffffdab0)
at /usr/ports/lang/php5/work/php-5.4.6/sapi/cli/php_cli.c:988
#6 0x00000000007bb2a9 in main (argc=3, argv=0x7fffffffdab0)
at /usr/ports/lang/php5/work/php-5.4.6/sapi/cli/php_cli.c:1364
I tried compiling everything back and forth, enabled and disabled all
kinds of PHP extensions but nothing helps. Segfault is coming always
back to me. Btw.
brfr@frodo> php -v
PHP 5.4.6 (cli) (built: Oct 3 2012 10:17:12) (DEBUG)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
works, and all non-mapscript PHP applications seem to run fine.I wonder
if the problem occurs because there are 2 versions of GD in use, PHP
uses its internal version and mapserver the one from the system, and
both mismatch in the minor version. FreeBSD GD is gd-2.0.35_8,1, PHP
uses [GD Version] => bundled (2.0.34 compatible).
So, finally, any tipps to solve this problem are greatly appreceated ...
Frank
PS
My installed PHP modules:
brfr@frodo> pkg_info | grep php5
php5-5.4.6 PHP Scripting Language
php5-bz2-5.4.6 The bz2 shared extension for php
php5-ctype-5.4.6 The ctype shared extension for php
php5-curl-5.4.6 The curl shared extension for php
php5-dom-5.4.6 The dom shared extension for php
php5-extensions-1.7 A "meta-port" to install PHP extensions
php5-filter-5.4.6 The filter shared extension for php
php5-gd-5.4.6 The gd shared extension for php
php5-gettext-5.4.6 The gettext shared extension for php
php5-hash-5.4.6 The hash shared extension for php
php5-iconv-5.4.6 The iconv shared extension for php
php5-imap-5.4.6 The imap shared extension for php
php5-json-5.4.6 The json shared extension for php
php5-mbstring-5.4.6 The mbstring shared extension for php
php5-mcrypt-5.4.6 The mcrypt shared extension for php
php5-openssl-5.4.6 The openssl shared extension for php
php5-pdo-5.4.6 The pdo shared extension for php
php5-pdo_pgsql-5.4.6 The pdo_pgsql shared extension for php
php5-pdo_sqlite-5.4.6 The pdo_sqlite shared extension for php
php5-pgsql-5.4.6 The pgsql shared extension for php
php5-phar-5.4.6 The phar shared extension for php
php5-posix-5.4.6 The posix shared extension for php
php5-session-5.4.6 The session shared extension for php
php5-simplexml-5.4.6 The simplexml shared extension for php
php5-tidy-5.4.6 The tidy shared extension for php
php5-tokenizer-5.4.6 The tokenizer shared extension for php
php5-xml-5.4.6 The xml shared extension for php
php5-xmlreader-5.4.6 The xmlreader shared extension for php
php5-xmlwriter-5.4.6 The xmlwriter shared extension for php
php5-zip-5.4.6 The zip shared extension for php
php5-zlib-5.4.6 The zlib shared extension for php
--
Frank BRONIEWSKI
METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN
tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu
[Index of Archives]
[PHP Users]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[Postgresql]
[PHP Books]
[PHP Databases]
[PHP SOAP]