malloc() problem using PHP/MapScript

Ben Sims benjaminsims at YAHOO.COM
Wed Oct 4 20:15:00 EDT 2006


Update:

The error has changed slightly after some minor application changes. I have also experimented with running a test script using the same code through the gdb debugger. If it might give anybody any clues, here is the backtrace:

*** glibc detected *** free(): invalid next size (fast): 0x08e825c0 ***

Program received signal SIGABRT, Aborted.
[Switching to Thread -1208609088 (LWP 5405)]
0x008527a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) backtrace
#0  0x008527a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00892905 in raise () from /lib/tls/libc.so.6
#2  0x008942b9 in abort () from /lib/tls/libc.so.6
#3  0x008c61ca in __libc_message () from /lib/tls/libc.so.6
#4  0x008cc6a8 in _int_free () from /lib/tls/libc.so.6
#5  0x008ccc7a in free () from /lib/tls/libc.so.6
#6  0x0076fe99 in shapeObj_destroy () from /usr/lib/php4/php_mapscript.so
#7  0x0075b8bb in php3_ms_free_shape () from /usr/lib/php4/php_mapscript.so
#8  0x081324d5 in list_entry_destructor (ptr=0x8e82494)
    at /tmp/php-4.4.4/Zend/zend_list.c:177
#9  0x08131196 in zend_hash_del_key_or_index (ht=0x8188440, arKey=0x0, 
    nKeyLength=0, h=79, flag=1) at /tmp/php-4.4.4/Zend/zend_hash.c:529
#10 0x081322e4 in _zend_list_delete (id=79)
    at /tmp/php-4.4.4/Zend/zend_list.c:56
#11 0x08124f45 in _zval_ptr_dtor (zval_ptr=0x8e75cc8)
    at /tmp/php-4.4.4/Zend/zend_execute_API.c:289
#12 0x0813128c in zend_hash_destroy (ht=0x8e7588c)
    at /tmp/php-4.4.4/Zend/zend_hash.c:558
#13 0x0812c642 in _zval_dtor (zvalue=0xbfead600)
    at /tmp/php-4.4.4/Zend/zend_variables.c:60
#14 0x08137a23 in zend_assign_to_variable (result=0x8da2508, op1=0x8da2518, 
    op2=0x8da2528, value=0x8e824b4, type=4, Ts=0xbfead640)
    at /tmp/php-4.4.4/Zend/zend_execute.c:462
---Type <return> to continue, or q <return> to quit---
#15 0x0813c05b in execute (op_array=0x8da103c)
    at /tmp/php-4.4.4/Zend/zend_execute.c:1393
#16 0x0813c9c1 in execute (op_array=0x8d4b894)
    at /tmp/php-4.4.4/Zend/zend_execute.c:1719
#17 0x0813c9c1 in execute (op_array=0x8c84144)
    at /tmp/php-4.4.4/Zend/zend_execute.c:1719
#18 0x0812d903 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /tmp/php-4.4.4/Zend/zend.c:934
#19 0x08105e18 in php_execute_script (primary_file=0xbfeb2d00)
    at /tmp/php-4.4.4/main/main.c:1752
#20 0x08145dbf in main (argc=2, argv=0xbfeb2dc4)
    at /tmp/php-4.4.4/sapi/cli/php_cli.c:832


Help!

----- Original Message ----
From: Ben Sims <benjaminsims at YAHOO.COM>
To: MAPSERVER-USERS at LISTS.UMN.EDU
Sent: Wednesday, 4 October, 2006 10:48:48 AM
Subject: [UMN_MAPSERVER-USERS] malloc() problem using PHP/MapScript

Hello to all,

I have an application which uses PHP/MapScript to draw basic maps. It works fine on my development machine (Mac OSX using precompiled libraries and a recently compiled version of the latest PHP source). I recently tried to transfer it to a production server:

Scientific Linux (basically Red Hat)
Apache 2.0.52
PHP compiled from most recent source
Most graphic libraries installed using yum
Geographic specific libraries (GEO, GDAL, PROJ4, taken from FWTools) - note that I had to move libproj.so.0 into the /usr/lib directory, and also libstdc++.5, since this system had libstdc++.6


Running the page which is supposed to draw maps, instead of displaying the page I am asked if I want to download it. So, I at first thought it was merely something to do with Apache configuration.

However, I note that although shape files have been generated, the image files for the map have not. Looking in the Apache error log, there is the following:

*** glibc detected *** malloc(): memory corruption: 0x094501c8 ***
[Wed Oct 04 10:37:57 2006] [notice] child pid 7507 exit signal Aborted (6)


There are also various PHP Notice errors, although these are the sort of thing I would usually ignore and am not sure they are related.

Could anyone advise me as to how to deal with this problem, or get more information?

Thanks,
Benjamin




        
___________________________________________________________ 
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street Journal 
http://uk.docs.yahoo.com/nowyoucan.html





		
___________________________________________________________ 
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street Journal 
http://uk.docs.yahoo.com/nowyoucan.html



More information about the mapserver-users mailing list