ID: 50111 Updated by: datib...@php.net Reported By: datib...@php.net -Status: Bogus +Status: Open Bug Type: Streams related Operating System: Linux PHP Version: 5.2.11 New Comment:
I'm not trying to disable memory_limit. Setting it to "0" just happens to make the issue appear faster. Changing it to the below value of 1k yields the same results as mentioned earlier, tested on the same 5 php configurations: ini_set("memory_limit", "1000"); Previous Comments: ------------------------------------------------------------------------ [2009-11-19 09:38:42] j...@php.net To disable memory_limit, you need to set it to -1, not 0. ------------------------------------------------------------------------ [2009-11-18 22:03:03] datib...@php.net <?php echo "This is PHP ", phpversion(),PHP_EOL; ini_set("memory_limit", "0"); for ($i=0;$i<2000;++$i) { $x = stream_context_create(array()); unset($x); } echo "Done", PHP_EOL; ?> ---------------- $ /usr/local/php-5.1.0/bin/php lala.php This is PHP 5.1.0 Done ---------------- $ /usr/local/php-5.1.1/bin/php lala.php This is PHP 5.1.1 Done ---------------- $ /usr/local/php-5.1.2/bin/php lala.php This is PHP 5.1.2 Done ---------------- $ /usr/local/php-5.2.9/bin/php lala.php This is PHP 5.2.9 Fatal error: Allowed memory size of 262144 bytes exhausted at /usr/local/src/php-5.2.9/Zend/zend_list.c:47 (tried to allocate 12 bytes) in /home/tjerk/lala.php on line 7 ---------------- $ /usr/local/php-5.2.11/bin/php lala.php This is PHP 5.2.11 Fatal error: Allowed memory size of 262144 bytes exhausted at /usr/local/src/php-5.2.11/main/streams/streams.c:1945 (tried to allocate 16 bytes) in /home/tjerk/lala.php on line 7 ---------------- $ /usr/local/php-5.3/bin/php lala.php This is PHP 5.3.0RC3-dev Done ------------------------------------------------------------------------ [2009-11-18 18:14:02] j...@php.net What code? There is no such script in this report that crashes. Not even when changed to loop thousands of times. Not with PHP_5_2 or PHP_5_3 or HEAD branches. So please, come up with a proper reproducing script. ------------------------------------------------------------------------ [2009-11-18 14:05:35] datib...@php.net I've change the summary a bit to avoid confusion with an actual memory leak (those that would get reported by php at the end of execution in debug mode). When kept running (using cli), an endless loop of given code would eventually result in an out-of-memory error. In PHP 5.3.x this no longer happens, so it seems that this has been rectified before, just not in this branch. It would be nice if the same fix could be applied here. ------------------------------------------------------------------------ [2009-11-09 17:11:31] j...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/50111 -- Edit this bug report at http://bugs.php.net/?id=50111&edit=1