PHP 4.0 Bug #5090: fsock.c Memory Leak
| From: | aronchick at sampleville dot com | Date: | Fri, 16 Jun 2000 17:50:19 +0000 |
| Subject: | PHP 4.0 Bug #5090: fsock.c Memory Leak | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21547@lists.php.net to get a copy of this message | ||
From: aronchick@sampleville.com
Operating system: FreeBSD 3.4
PHP version: 4.0.0 Release
PHP Bug Type: Other
Bug description: fsock.c Memory Leak
This bug happens intermittenly (sp?), so I can't track it down, but it doesn't happen very
often. Here is the message:
fsock.c(299) : Freeing 0x08252264 (20 bytes), script=/xxxx/xxxx/xxxx/xxxx/xxxx/xxxx.php
Last leak repeated 1 time
Here's my socket code:
$fp = 0;
$timer = 0;
while ( !( $fp = fsockopen($host,$port, &$errno, &$errstr, 1) ) && ($timer
< 10) )
{
$timer++;
sleep(1);
}
if ($fp) {
set_socket_blocking($fp, FALSE);
$msg = "POST $sendpath HTTP/1.1\n";
$msg .= "Host: $host\n";
$msg .= "Content-type: application/x-www-form-urlencoded\n";
$msg .= "Content-length: $content_length\n";
$msg .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98;
DigExt)\n";
$msg .= "Connection: close\n\n";
$msg .= $content."\n\n";
fputs($fp, $msg);
}
$startgets = time();
do
{
$results.=fgets($fp,1024);
}
while (!feof($fp) && ((time()-$startgets) < 10) );
fclose($fp);
and the compile stuff:
./configure --with-mysql --enable-track-vars --with-system-regex
--with-config-file-path=/usr/local/etc --enable-track-vars