ID: 17566
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Analyzed
Bug Type: Apache2 related
Operating System: BSD/OS 4.2
-PHP Version: 4.4-dev
+PHP Version: 4.3-dev
New Comment:
--disable-debug affects the display of the memory leak :-)
It does not affect the error itself. Still an increasing load.
I've added some trace warnings, and it seems that every string is
passed through php_escape_html_entities twice! Here's an anonimized
snippet:
PHP Warning: oldlen is 15. old is <SERVER_SOFTWARE>,
newlen=1210382182, all=1, quote_style=2, hint_charset is <(null)>
in /webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: Putting a terminator at position 15 in
/webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: Returning replaced <SERVER_SOFTWARE> (len=15) in
/webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: oldlen is 15. old is <SERVER_SOFTWARE>,
newlen=1211165388, all=1, quote_style=2, hint_charset is <(null)>
in /webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: Putting a terminator at position 15 in
/webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: Returning replaced <SERVER_SOFTWARE> (len=15) in
/webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: oldlen is 34. old is <Apache/2.0.43 (Unix)
PHP/4.4.0-dev>, newlen=1210382258, all=1, quote_style=2, hint_chars
et is <(null)>
in /webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: Putting a terminator at position 34 in
/webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: Returning replaced <Apache/2.0.43 (Unix) PHP/4.4.0-dev>
(len=34) in /webdocs/host.domain.nl/public_html/php
2345.php on line 2
PHP Warning: oldlen is 34. old is <Apache/2.0.43 (Unix)
PHP/4.4.0-dev>, newlen=1211165388, all=1, quote_style=2, hint_chars
et is <(null)>
in /webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: Putting a terminator at position 34 in
/webdocs/host.domain.nl/public_html/script.php on line 2
PHP Warning: Returning replaced <Apache/2.0.43 (Unix) PHP/4.4.0-dev>
(len=34) in /webdocs/host.domain.nl/public_html/php
2345.php on line 2
Previous Comments:
------------------------------------------------------------------------
[2002-10-07 06:41:36] [EMAIL PROTECTED]
The problem is in the recent changes to ext/standard/info.c which is
calling php_escape_html_entities (via php_info_html_esc) and PUTS()-ing
the result.
It never efree's it.
I suspect the loading problems will go away if you build a
--disable-debug version of PHP.
------------------------------------------------------------------------
[2002-10-06 23:09:07] [EMAIL PROTECTED]
PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen,
int *newlen, int all, int quote_style, char *hint_char
set TSRMLS_DC)
{
int i, j, maxlen, len;
char *replaced;
enum entity_charset charset = determine_charset(hint_charset
TSRMLS_CC);
int matches_map;
maxlen = 2 * oldlen;
if (maxlen < 128)
maxlen = 128; replaced = emalloc (maxlen); // #line 667
len = 0;
i = 0;
while (i < oldlen) {
....
}
}
replaced[len] = '\0';
...
So what happens if oldlen = 0 and more importantly: how can oldlen
become 0?
------------------------------------------------------------------------
[2002-10-06 23:01:29] [EMAIL PROTECTED]
hmm......that is a hint:
/home/mdev/cvs/php4/ext/standard/html.c(667) : Freeing 0x0820BA24 (396
bytes), script=-
Last leak repeated 383 times
383 times?
------------------------------------------------------------------------
[2002-10-06 22:57:30] [EMAIL PROTECTED]
No change at all.
Apache 2.0.43.
load averages: 6.81, 3.75, 1.91
149 processes: 2 running, 147 sleeping
CPU states: 0.2% user, 0.0% nice, 0.2% system, 0.0% interrupt,
99.6% idle
Memory: Real: 318M/397M Virt: 440M/1252M Free: 477M
------------------------------------------------------------------------
[2002-09-29 22:55:17] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
------------------------------------------------------------------------
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/17566
--
Edit this bug report at http://bugs.php.net/?id=17566&edit=1