#20665 [Fbk]: Memory leaks and allocation problems
| From: | msopacua@php.net | Date: | Sat, 30 Nov 2002 09:36:44 +0000 |
| Subject: | #20665 [Fbk]: Memory leaks and allocation problems | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26215@lists.php.net to get a copy of this message | ||
ID: 20665
Updated by: msopacua@php.net
Reported By: msopacua@php.net
Status: Feedback
Bug Type: Apache related
Operating System: BSD/OS 4.2
PHP Version: 4.3.0RC1
New Comment:
Traced the segfaults to an infinite loop in one script in a situation
that shouldn't normally occur (iow sloppy coding :).
I used squid in accellerator mode, to find out which script it was (For
reference: grep for 'HTTP/1.[01]" 503' and use emulate_httpd_log On).
It would really be nice, if emalloc failures could report some more
info than 'oops, I failed'.
The memleaks are still there on SIGHUP and are unrelated. Will try RC2
this weekend.
Previous Comments:
------------------------------------------------------------------------
[2002-11-28 09:00:07] msopacua@php.net
CFLAGS='-O0' \
./configure \
--prefix=/phpct \
--with-apache=../apache_1.3.27 \
--enable-cli \
--disable-cgi \
--enable-debug \
--enable-magic-quotes \
--disable-short-tags \
--with-zlib \
--with-zlib-dir=/usr \
--enable-calendar \
--enable-ftp \
--with-mhash=/weblib/local \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm
waiting for a coredump.. :)
------------------------------------------------------------------------
[2002-11-28 08:17:25] iliaa@php.net
As a security procution Apache does not write core files, in order to
make it do so you must tell it where to write core files using:
CoreDumpDirectory /tmp.
In debug builds Zend will segfault if emalloc() fails to allocate
memory.
Also, could you please include the list of extensions you've compiled
your PHP with (put config.nice online somewhere?).
------------------------------------------------------------------------
[2002-11-28 06:34:38] msopacua@php.net
Yes, it does put out the scriptname, with the mem leaks -it's always
the same script, which is nothing more than a static file which echo's
the current timestamp into 8 different places for banners - that's why
it doesn't make sence.
However - when an emalloc call fails, it doesn't output the scriptname
nor the c file, which called the emalloc.
It only happens a few times a day, so the cause could be the memory
leaks or it could be a script which isn't requested too much.
I see a SIGSEV afterwards, but no core dump and it's not like I can
startup Apache from gdb and request a certain file to reproduce it,
since I have no idea where to look.
I will recheck settings to make it dump core.
What's also strange is that these leaks only get reported on a SIGHUP.
Through the entire error log, there are no other leak reports. This
would suggest something in the SIGCHILD and therefore the shutdown
handler.
------------------------------------------------------------------------
[2002-11-27 17:03:22] iliaa@php.net
The code that reports memory leaks also outputs PHP script name where
the leak had occured. I am not sure if this was part of the RC1, so
just to be sure, try RC2 and make sure to clear the error log so that
old messages do not get confused for new ones.
------------------------------------------------------------------------
[2002-11-27 03:05:26] msopacua@php.net
Yep apache.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/20665
--
Edit this bug report at http://bugs.php.net/?id=20665&edit=1