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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 05:01:29 2024 UTC