[mapserver-dev] PHP Mapscript

Frank Broniewski brfr at metrico.lu
Wed Oct 3 06:37:44 PDT 2012


Am 2012-10-03 14:13, schrieb Daniel Morissette:
> On 12-10-03 8:11 AM, thomas bonfort wrote:
>> On Wed, Oct 3, 2012 at 2:09 PM, Daniel Morissette
>> <dmorissette at mapgears.com> wrote:
>>>
>>> BTW, Thomas, the mapObj constructor loads and parses the mapfile, so
>>> there
>>> is some MapServer code which is called, but nothing in GD yet.
>> Daniel, I did not see any reference to mapserver/mapscript in the
>> provided backtrace, that's what I meant.
>>
>
> Ah, ok, I see what you meant.
>
> Not sure what to think. Maybe running the script under Valgrind would
> provide some hints.
>

Here's a valgrind output. Not that this tells me much, but since you 
asked :-)

brfr at frodo> valgrind --leak-check=yes php -f pi.php
==89945== Memcheck, a memory error detector
==89945== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==89945== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==89945== Command: php -f pi.php
==89945==
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=SHAPEFILE==89945== Invalid read of size 8
==89945==    at 0x69A10A: zend_std_get_constructor 
(zend_object_handlers.c:1271)
==89945==    by 0x6A406E: ZEND_NEW_SPEC_HANDLER (zend_vm_execute.h:816)
==89945==    by 0x6A0DB0: execute (zend_vm_execute.h:410)
==89945==    by 0x6627B8: zend_execute_scripts (zend.c:1289)
==89945==    by 0x5CAA85: php_execute_script (main.c:2473)
==89945==    by 0x7BA2C3: do_cli (php_cli.c:988)
==89945==    by 0x7BB2A8: main (php_cli.c:1364)
==89945==  Address 0xa9693450 is not stack'd, malloc'd or (recently) free'd
==89945==
==89945==
==89945== Process terminating with default action of signal 11 
(SIGSEGV): dumping core
==89945==  Access not within mapped region at address 0xA9693450
==89945==    at 0x69A10A: zend_std_get_constructor 
(zend_object_handlers.c:1271)
==89945==    by 0x6A406E: ZEND_NEW_SPEC_HANDLER (zend_vm_execute.h:816)
==89945==    by 0x6A0DB0: execute (zend_vm_execute.h:410)
==89945==    by 0x6627B8: zend_execute_scripts (zend.c:1289)
==89945==    by 0x5CAA85: php_execute_script (main.c:2473)
==89945==    by 0x7BA2C3: do_cli (php_cli.c:988)
==89945==    by 0x7BB2A8: main (php_cli.c:1364)
==89945==  If you believe this happened as a result of a stack
==89945==  overflow in your program's main thread (unlikely but
==89945==  possible), you can try to increase the size of the
==89945==  main thread stack using the --main-stacksize= flag.
==89945==  The main thread stack size used in this run was 16777216.
==89945==
==89945== HEAP SUMMARY:
==89945==     in use at exit: 3,782,208 bytes in 19,011 blocks
==89945==   total heap usage: 20,594 allocs, 1,583 frees, 4,141,359 
bytes allocated
==89945==
==89945== 12 bytes in 1 blocks are definitely lost in loss record 557 of 
7,902
==89945==    at 0x153310B: malloc (in 
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==89945==    by 0x6543D1D: pthread_mutexattr_init (in /lib/libthr.so.3)
==89945==    by 0x7D06EA1: NCSMutexInit (in /usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x7D07B6F: 
__static_initialization_and_destruction_0(int, int) (in 
/usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x7D14931: ??? (in /usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x7FF00050F: ???
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x16D11F: ???
==89945==    by 0x7D03885: ??? (in /usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x17157: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x177B5: ??? (in /libexec/ld-elf.so.1)
==89945==
==89945== 12 bytes in 1 blocks are definitely lost in loss record 558 of 
7,902
==89945==    at 0x153310B: malloc (in 
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==89945==    by 0x6543D1D: pthread_mutexattr_init (in /lib/libthr.so.3)
==89945==    by 0x7D06EA1: NCSMutexInit (in /usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x7AF151F: 
__static_initialization_and_destruction_0(int, int) (in 
/usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x7AF2121: ??? (in /usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x7FF00050F: ???
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x16D15F: ???
==89945==    by 0x7AE2335: ??? (in /usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x17157: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x177B5: ??? (in /libexec/ld-elf.so.1)
==89945==
==89945== 12 bytes in 1 blocks are definitely lost in loss record 559 of 
7,902
==89945==    at 0x153310B: malloc (in 
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==89945==    by 0x6543D1D: pthread_mutexattr_init (in /lib/libthr.so.3)
==89945==    by 0x7D06EA1: NCSMutexInit (in /usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x7AECD2A: 
__static_initialization_and_destruction_0(int, int) (in 
/usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x7AF2121: ??? (in /usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x7FF00050F: ???
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x16D15F: ???
==89945==    by 0x7AE2335: ??? (in /usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x17157: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x177B5: ??? (in /libexec/ld-elf.so.1)
==89945==
==89945== 12 bytes in 1 blocks are definitely lost in loss record 560 of 
7,902
==89945==    at 0x153310B: malloc (in 
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==89945==    by 0x6543D1D: pthread_mutexattr_init (in /lib/libthr.so.3)
==89945==    by 0x7D06EA1: NCSMutexInit (in /usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x7AE8E7A: 
__static_initialization_and_destruction_0(int, int) (in 
/usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x7AF2121: ??? (in /usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x7FF00050F: ???
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x16D15F: ???
==89945==    by 0x7AE2335: ??? (in /usr/local/lib/libNCSCnet.so.0)
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x17157: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x177B5: ??? (in /libexec/ld-elf.so.1)
==89945==
==89945== 12 bytes in 1 blocks are definitely lost in loss record 561 of 
7,902
==89945==    at 0x153310B: malloc (in 
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==89945==    by 0x6543D1D: pthread_mutexattr_init (in /lib/libthr.so.3)
==89945==    by 0x7D06EA1: NCSMutexInit (in /usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x76A115F: 
__static_initialization_and_destruction_0(int, int) (in 
/usr/local/lib/libNCSEcw.so.0)
==89945==    by 0x76A13C1: ??? (in /usr/local/lib/libNCSEcw.so.0)
==89945==    by 0x7FF00050F: ???
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x16D1DF: ???
==89945==    by 0x7607365: ??? (in /usr/local/lib/libNCSEcw.so.0)
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x17157: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x177B5: ??? (in /libexec/ld-elf.so.1)
==89945==
==89945== 12 bytes in 1 blocks are definitely lost in loss record 562 of 
7,902
==89945==    at 0x153310B: malloc (in 
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==89945==    by 0x6543D1D: pthread_mutexattr_init (in /lib/libthr.so.3)
==89945==    by 0x7D06EA1: NCSMutexInit (in /usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x7D07932: CNCSEvent::CNCSEvent(bool, bool, char*) (in 
/usr/local/lib/libNCSUtil.so.0)
==89945==    by 0x761EB01: 
__static_initialization_and_destruction_0(int, int) (in 
/usr/local/lib/libNCSEcw.so.0)
==89945==    by 0x76A13C1: ??? (in /usr/local/lib/libNCSEcw.so.0)
==89945==    by 0x7FF00050F: ???
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x16D1DF: ???
==89945==    by 0x7607365: ??? (in /usr/local/lib/libNCSEcw.so.0)
==89945==    by 0x2471FF: ??? (in /libexec/ld-elf.so.1)
==89945==    by 0x17157: ??? (in /libexec/ld-elf.so.1)
==89945==
==89945== LEAK SUMMARY:
==89945==    definitely lost: 72 bytes in 6 blocks
==89945==    indirectly lost: 0 bytes in 0 blocks
==89945==      possibly lost: 0 bytes in 0 blocks
==89945==    still reachable: 3,782,136 bytes in 19,005 blocks
==89945==         suppressed: 0 bytes in 0 blocks
==89945== Reachable blocks (those to which a pointer was found) are not 
shown.
==89945== To see them, rerun with: --leak-check=full --show-reachable=yes
==89945==
==89945== For counts of detected and suppressed errors, rerun with: -v
==89945== ERROR SUMMARY: 7 errors from 7 contexts (suppressed: 0 from 0)
Segmentation fault


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