From: mikeb at tracersinfo dot com
Operating system: WinXP; Mandrake Linux 2.4.22-26
PHP version: 4.3.7
PHP Bug Type: Reproducible crash
Bug description: Segmentation fault/crash while destroying large arrays at end of
execution
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 bug report at http://bugs.php.net/?id=28676&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28676&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28676&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28676&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28676&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28676&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28676&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28676&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28676&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28676&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28676&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28676&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28676&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28676&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28676&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28676&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28676&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28676&r=float