From:             mikael at chl dot chalmers dot se
Operating system: Linux 2.6.10-ac9
PHP version:      4.4.0
PHP Bug Type:     Apache2 related
Bug description:  Hang (100% CPU) in malloc_consolidate

Description:
------------
After some time (hours on a busy site), Apache processes hanged in
malloc_consolidate() appear. Don't know if this really is a problem in PHP
but we're hoping to get some clues, since both the backtraces we've
extracted goes through libphp4.so (in php_handler() and mtx_append())

The problem appeared after upgrading from PHP 4.3.8 to 4.4.0 and the only
./configure difference was the need to add --with-imap-ssl to get 4.4.0 to
build

Reproduce code:
---------------
Intermediate problem, hard to reproduce

Actual result:
--------------
If need be we can recompile apache/apr with debug symbols to try and
extract more information and variable values. We have a couple of
coredumps saved as it is. 

These are the two difference backtraces we've seen so far.

#0 0xb7b9c35e in malloc_consolidate () from /lib/tls/libc.so.6
#1 0xb7b9bb29 in _int_malloc () from /lib/tls/libc.so.6
#2 0xb7b9aecd in malloc () from /lib/tls/libc.so.6
#3 0xb7d0a692 in allocator_alloc () from
/usr/local/apache2/lib/libapr-0.so.0
#4 0xb7e00652 in apr_bucket_alloc () from
/usr/local/apache2/lib/libaprutil-0.so.0
#5 0xb7e00063 in apr_brigade_writev () from
/usr/local/apache2/lib/libaprutil-0.so.0
#6 0x08065119 in basic_http_header ()
#7 0x08062752 in ap_http_header_filter ()
#8 0x08075c6c in ap_pass_brigade ()
#9 0x080784cf in ap_content_length_filter ()
#10 0x08075c6c in ap_pass_brigade ()
#11 0x08063ff4 in ap_byterange_filter ()
#12 0x08075c6c in ap_pass_brigade ()
#13 0x08075c6c in ap_pass_brigade ()
#14 0xb77da099 in php_handler () from
/foobar/web/mychl/modules/libphp4.so
#15 0x08068b70 in ap_invoke_handler ()
#16 0x080662b5 in ap_internal_redirect ()
#17 0xb7ab2b7e in handler_redirect () from
/foobar/web/mychl/modules/mod_rewrite.so
#18 0x08068b70 in ap_invoke_handler ()
#19 0x0806604b in ap_process_request ()
#20 0x08060ebc in ap_process_http_connection ()
#21 0x08073b65 in ap_process_connection ()
#22 0x0806867a in child_main ()
#23 0x080679a5 in make_child ()
#24 0x08067bfa in perform_idle_server_maintenance ()
#25 0x080674bd in ap_mpm_run ()
#26 0x0806e9e3 in main ()


#0 0xb7b9c364 in malloc_consolidate () from /lib/tls/libc.so.6
#1 0xb7b9bb29 in _int_malloc () from /lib/tls/libc.so.6
#2 0xb7b9aecd in malloc () from /lib/tls/libc.so.6
#3 0xb7d0a692 in allocator_alloc () from
/usr/local/apache2/lib/libapr-0.so.0
#4 0xb7d099a1 in apr_pool_create_ex () from
/usr/local/apache2/lib/libapr-0.so.0
#5 0x0807f7b4 in core_output_filter ()
#6 0x08075c6c in ap_pass_brigade ()
#7 0x080628c7 in ap_http_header_filter ()
#8 0x08075c6c in ap_pass_brigade ()
#9 0x080784cf in ap_content_length_filter ()
#10 0x08075c6c in ap_pass_brigade ()
#11 0x08063ff4 in ap_byterange_filter ()
#12 0x08075c6c in ap_pass_brigade ()
#13 0x08075c6c in ap_pass_brigade ()
#14 0xb77da099 in mtx_append () from /foobar/web/mychl/modules/libphp4.so
#15 0x08068b70 in ap_invoke_handler ()
#16 0x080662b5 in ap_internal_redirect ()
#17 0xb7ab2b7e in handler_redirect () from
/foobar/web/mychl/modules/mod_rewrite.so
#18 0x08068b70 in ap_invoke_handler ()
#19 0x0806604b in ap_process_request ()
#20 0x08060ebc in ap_process_http_connection ()
#21 0x08073b65 in ap_process_connection ()
#22 0x0806867a in child_main ()
#23 0x080679a5 in make_child ()
#24 0x08067bfa in perform_idle_server_maintenance ()
#25 0x080674bd in ap_mpm_run ()
#26 0x0806e9e3 in main ()


env CFLAGS="-O3 -march=i686" ./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--disable-cgi \
--with-cpdflib=/usr/local \
--enable-ftp \
--with-gd \
--with-ttf=/usr \
--enable-gd-native-ttf \
--with-imap \
--with-imap-ssl \
--with-kerberos=/usr/kerberos \
--with-ldap \
--with-mysql=/usr/local/mysql-4.1 \
--with-oci8 \
--with-iodbc=/usr/local \
--enable-sockets \
--enable-yp \
--with-jpeg-dir=/usr \
--with-zlib-dir=/usr \
--with-png-dir=/usr \
--with-gettext \
--enable-exif \
--with-openssl \
--enable-pcntl \
--with-xmlrpc \
--enable-mbstring

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

Reply via email to