From:             php at bust dot ac
Operating system: RedHat 9
PHP version:      5.0.3
PHP Bug Type:     Reproducible crash
Bug description:  memory leak in stream_socket_recvfrom()

Description:
------------
using the stream_socket_recvfrom function in php 5.0.3 seems to leak
memory.

my php is running with php.ini-recommended with the only changes being
report_zend_debug = on
display_errors = on

=== output of php -i ===
PHP Version => 5.0.3

System => Linux *************** 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003
i686
Build Date => Jan  4 2005 13:46:18
Configure Command =>  './configure' '--with-apxs2=/usr/sbin/apxs'
'--enable-sockets' '--with-mysql' '--with-mhash' '--with-dom'
'--enable-memory-limit' '--enable-debug'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini
PHP API => 20031224
PHP Extension => 20041030
Zend Extension => 220040412
Debug Build => yes
Thread Safety => disabled
IPv6 Support => enabled
Registered PHP Streams => php, file, http, ftp
Registered Stream Socket Transports => tcp, udp, unix, udg



Reproduce code:
---------------
<?php
        $sp = stream_socket_client( 'tcp://www.google.com:80',$null,
$null2, 30);
        stream_set_blocking($sp, false);
        while (true){
                $gtCheck = stream_socket_recvfrom($sp, 1500);
                echo 'loop = '.$count++."\n";
        }
?>


Expected result:
----------------
script should run forever

Actual result:
--------------
=== end of script output ===
loop = 5551

Fatal error: Allowed memory size of 8388608 bytes exhausted at
/usr/src/php-5.0.3/ext/standard/streamsfuncs.c:330 (tried to allocate 1501
bytes) in /root/test.php on line 5
Allowed memory size of 8388608 bytes exhausted at
/usr/src/php-5.0.3/Zend/zend_stack.c:28 (tried to allocate 256 bytes)

-- 
Edit bug report at http://bugs.php.net/?id=31408&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31408&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31408&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31408&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31408&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31408&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31408&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31408&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31408&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31408&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31408&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31408&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31408&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31408&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31408&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31408&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31408&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31408&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31408&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31408&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31408&r=mysqlcfg

Reply via email to