php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5090 fsock.c Memory Leak
Submitted: 2000-06-16 19:50 UTC Modified: 2000-06-19 11:05 UTC
From: aronchick at sampleville dot com Assigned:
Status: Closed Package: Other
PHP Version: 4.0.0 Release OS: FreeBSD 3.4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: aronchick at sampleville dot com
New email:
PHP Version: OS:

 

 [2000-06-16 19:50 UTC] aronchick at sampleville dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-19 11:05 UTC] thies at cvs dot php dot net
fixed in CVS - thanx
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Sep 20 01:00:01 2025 UTC