[mapserver-dev] PHP Mapscript

Frank Broniewski brfr at metrico.lu
Mon Oct 8 01:51:04 PDT 2012


If I may come back to this topic: I want to share my php_mapscript 
compile errors when doing make. Maybe there's a hint hidden. If you 
please want to have a look at the error messages and provide some 
feedback if the errors are 'normal' or there's a real problem.

Another thing I noticed: I can create other objects without having a 
segfault. For example, rectObj or pointObj seem to work fine. Even 
layerObj tells me that it needs a mapObj for initialisation instead of 
segfaulting.

Thanks,

Frank

mapstring.c: In function 'msGetEncodedString':
mapstring.c:1697: warning: passing argument 2 of 'libiconv' from 
incompatible pointer type
mapstring.c: In function 'msConvertWideStringToUTF8':
mapstring.c:1754: warning: passing argument 2 of 'libiconv' from 
incompatible pointer type


php_mapscript_util.c: In function 'mapscript_object_new':
php_mapscript_util.c:40: warning: unused variable 'temp'
php_mapscript_util.c:72:15: warning: extra tokens at end of #endif directive
php_mapscript_util.c: In function 'mapscript_object_new_ex':
php_mapscript_util.c:62: warning: unused variable 'temp'


Am 2012-10-03 09:04, schrieb thomas bonfort:
> Frank,
> please provide the full backtrace when the code segfaults  ("bt" at
> the gdb prompt)
>
> --
> thomas
>
> On Wed, Oct 3, 2012 at 8:33 AM, Frank Broniewski <brfr at metrico.lu> wrote:
>> Hi,
>>
>> I am having problems using mapscript on FreeBSD. I tried alreay the users
>> mailing list, but without success. Maybe some developers can help me with my
>> problem.
>>
>>
>> I am forwarding this from the FreeBSD mailing list. Maybe someone here
>> has a clue. I have a problem with PHP 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 at 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 at 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
>> [snip ...]
>> 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=0x8024762c8)
>>       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 802407400 (LWP 100919/php)]
>> (gdb)
>>
>>
>> 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.
>> root at frodo# php -v
>> PHP 5.4.6 (cli) (built: Sep 26 2012 15:32:23) (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.
>>
>> So, finally, any tipps to solve this problem are greatly appreceated ...
>>
>> Frank
>> --
>> 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
>>
>> _______________________________________________
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev


-- 
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


More information about the mapserver-dev mailing list