#40770 [Opn->Fbk]: Apache child exits when PHP memory limit reached

From: Date: Sun, 11 Mar 2007 14:52:57 +0000
Subject: #40770 [Opn->Fbk]: Apache child exits when PHP memory limit reached
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110195@lists.php.net to get a copy of this message
ID: 40770 Updated by: iliaa@php.net Reported By: php at edwardk dot info -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Windows 2003 PHP Version: 5.2.1 New Comment: Are you running debug build of PHP by any chance? Previous Comments: ------------------------------------------------------------------------ [2007-03-10 03:24:58] php at edwardk dot info Description: ------------ Running Apache 1.3.37 with PHP 5.2.1 on Windows 2003 Standard 32bit The following PHP code was called from a browser with the size=149 (to simulate 149MB use) and the PHP memory limit is 160M. Reproduce code: --------------- <? ini_set('display_errors',true); if (isset($_GET['size']) && $_GET['size'] < 200) { $mb = intval($_GET['size']); } else { $mb=5; } $var = ''; echo 'Memory limit: '.ini_get('memory_limit').'<br>'; for ($i=0; $i<=$mb; $i++) { $var.= str_repeat('a',1*1024*1024); echo memory_get_usage().'<br>'; } echo 'String length: '. strlen($var); ?> Expected result: ---------------- PHP should, if it did run out of memory, exit with something along the lines of Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy bytes) otherwise, the script should execute without crashing. Actual result: -------------- Apache child exits, browser waiting for the result of the page get a TCP connection reset and no page loaded. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40770&edit=1

« previous php.bugs (#110195) next »