|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-04 16:25 UTC] derick@php.net
[2005-01-04 16:32 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
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)