#28676 [Opn->WFx]: Segmentation fault/crash while destroying large arrays at end of execution

From: Date: Tue, 08 Jun 2004 07:57:34 +0000
Subject: #28676 [Opn->WFx]: Segmentation fault/crash while destroying large arrays at end of execution
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60553@lists.php.net to get a copy of this message
ID: 28676 Updated by: derick@php.net Reported By: mikeb at tracersinfo dot com -Status: Open +Status: Wont fix Bug Type: Reproducible crash Operating System: WinXP; Mandrake Linux 2.4.22-26 PHP Version: 4.3.7 New Comment: This is a limitation in PHP 4 (elements can only have 2^16 references too them), and is addressed in PHP 5. We will not fix this for PHP 4. Previous Comments: ------------------------------------------------------------------------ [2004-06-07 18:38:58] mikeb at tracersinfo dot com Description: ------------ In WinXP, crash occurs at $howmany >= 65537; in Mandrake Linux, crash (specifying Segmentation fault) occurs at $howmany >= 131073. Note that crash only occurs *after* all statements are performed. I have been able to reproduce this everywhere, with any 4.3.2+ version of PHP on all platforms, regardless of configuration or state of php.ini. Reproduce code: --------------- <?php $string = "X"; $howmany = 65537; $b4guts = mktime(); $guts = array(); for ( $x = 0; $x < $howmany; $x++ ) { $guts[$x] = $string; } $afterguts = mktime(); $gutstime = $afterguts - $b4guts; echo "\nGuts built. Time $gutstime seconds. ", count($guts), " elements\n"; ?> Expected result: ---------------- Normal program termination. Actual result: -------------- Windows generates a GPF requiring close of the process. Mandrake Linux generates a "Segmentation fault". ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28676&edit=1

« previous php.bugs (#60553) next »