#31508 [NEW]: Apache 1.3.33 endless loop in _int_malloc()

From: Date: Wed, 12 Jan 2005 03:24:36 +0000
Subject: #31508 [NEW]: Apache 1.3.33 endless loop in _int_malloc()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71909@lists.php.net to get a copy of this message
From:             yml at dtlink dot com
Operating system: Linux (RedHat 9)
PHP version:      4.3.10
PHP Bug Type:     Apache related
Bug description:  Apache 1.3.33 endless loop in _int_malloc()

Description:
------------
Apache 1.3.33 is sitting and spinning if PHP 4.3.10 not compiled with
--enable-debug.

RedHat 9. Apache 1.3.33. PHP 4.3.10. 

Config.status:
./configure  --with-apxs=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql --prefix=/usr/local/php_4.3.10
--with-mcrypt=/usr/local/lib --with-gd --with-jpeg-dir=/usr/lib
--with-zlib-dir=/usr/lib --with-png-dir=/usr/lib --enable-memory-limit

Running php.ini-recommended. diplaying errors on. max exec time 120
seconds. max mem use 25megs.

I have a huge body of code that implements a component framework. It
involves large objects trees. I do a tremendous amount of object reference
passing. 

I have a situation where if I load a certain number of object trees on a
page, apache will sit and spin at 99% CPU utilization. One object tree
less, it works fine. One more, it spins (where spinning means forever ..
the max exec time interrupt never occurs, the process does not continue to
grow, no messages in the logs.)

I am sure that this bug is being invoked due to some error in my code ...
probably a calling a method on an invalid object reference which always
seems to confuse the script engine. 

However this code has worked flawlessly in the past ... and it works
flawlessly if I compile PHP with --enable-debug.

I realize this isn't enough info to go on. I'm posting it in the hopes
that maybe others have seen similar behavior.

If you want to contact me, I get about 2000 pieces of SPAM a day. To
contact me directly please use the form at:

  http://www.yml.com/Contact_Yermo.html

so I can add you to my white list.


Actual result:
--------------
Running httpd in gdb and getting it to spin to 99.9% utilization:

This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) run -X -F
Starting program: /usr/local/apache/bin/httpd -X -F
 
Program received signal SIGINT, Interrupt.
0x4011cf77 in _int_malloc () from /lib/libc.so.6
(gdb) where
#0  0x4011cf77 in _int_malloc () from /lib/libc.so.6
#1  0x4011d810 in _int_realloc () from /lib/libc.so.6
#2  0x4011c10d in realloc () from /lib/libc.so.6
#3  0x40308f5d in _erealloc (ptr=0x200f00, size=35, allow_failure=0)
    at /usr/local/src/php-4.3.10/Zend/zend_alloc.c:329
#4  0x40313c65 in add_string_to_string (result=0xbfff9150,
op1=0xbfff9150,
    op2=0x95e7ad4) at
/usr/local/src/php-4.3.10/Zend/zend_operators.c:1029
#5  0x403243f2 in execute (op_array=0x81eef54)
    at /usr/local/src/php-4.3.10/Zend/zend_execute.c:1508
#6  0x40324c13 in execute (op_array=0x81b97c8)
    at /usr/local/src/php-4.3.10/Zend/zend_execute.c:1686
#7  0x40324c13 in execute (op_array=0x810af5c)
    at /usr/local/src/php-4.3.10/Zend/zend_execute.c:1686
#8  0x40316cab in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /usr/local/src/php-4.3.10/Zend/zend.c:900
#9  0x402f04af in php_execute_script (primary_file=0xbfffeb80)
    at /usr/local/src/php-4.3.10/main/main.c:1736
#10 0x40328cda in apache_php_module_main (r=0x80ff654,
display_source_mode=0)
    at /usr/local/src/php-4.3.10/sapi/apache/sapi_apache.c:54
#11 0x40329709 in send_php (r=0x80ff654, display_source_mode=0,
filename=0x0)
    at /usr/local/src/php-4.3.10/sapi/apache/mod_php4.c:621
#12 0x403298ad in send_parsed_php (r=0x80ff654)
    at /usr/local/src/php-4.3.10/sapi/apache/mod_php4.c:636

etc.

The kicker is that if I compile PHP with --enable-debug it will not spin.
However I get endless memory leak messages such as:

/usr/local/src/php-4.3.10/Zend/zend_execute.c(789) :  Freeing 0x0D20E5DC
(44 bytes),
script=/usr/local/WWW/mobie.yml.com/html/mobie/content_server/publish.php
/usr/local/src/php-4.3.10/Zend/zend_variables.c(123) : Actual location
(location was relayed)
Last leak repeated 1165 times
/usr/local/src/php-4.3.10/ext/xml/xml.c(262) :  Freeing 0x0D20C524 (5
bytes),
script=/usr/local/WWW/mobie.yml.com/html/mobie/content_server/publish.php
Last leak repeated 6677 times
/usr/local/src/php-4.3.10/ext/xml/xml.c(647) :  Freeing 0x0D20A214 (12
bytes),
script=/usr/local/WWW/mobie.yml.com/html/mobie/content_server/publish.php
Last leak repeated 6076 times
/usr/local/src/php-4.3.10/ext/xml/xml.c(258) :  Freeing 0x0D209D84 (12
bytes),
script=/usr/local/WWW/mobie.yml.com/html/mobie/content_server/publish.php
Last leak repeated 6677 times
/usr/local/src/php-4.3.10/Zend/zend_API.c(842) :  Freeing 0x0D2080C4 (12
bytes), 


-- 
Edit bug report at http://bugs.php.net/?id=31508&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31508&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31508&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31508&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31508&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31508&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31508&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31508&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31508&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31508&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31508&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=31508&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=31508&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31508&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31508&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31508&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31508&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31508&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31508&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31508&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31508&r=mysqlcfg


Thread (15 messages)

« previous php.bugs (#71909) next »