ID: 33551 Updated by: [EMAIL PROTECTED] Reported By: bertrand at toggg dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux 2.6.11-1 glibc 2.3.5-0 PHP Version: 4CVS-2005-07-02 (stable) New Comment:
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 And this is addressed in PHP 5.0 - a backport of the fix will not be made to PHP 4. Previous Comments: ------------------------------------------------------------------------ [2005-07-02 20:17:40] bertrand at toggg dot com Description: ------------ This script simply augments an array by duplicating its first element a parameter number of time, then displays count of the array and memory usage. $ php finout.php 65536 count:65536/2968016 bytes $ php finout.php 65537 count:65537/3230200 bytes *** glibc detected *** double free or corruption (!prev): 0x0923ce30 *** Aborted When count reaches 65537 glibc issues this "post-mortem" message If instead of $arr[] = $arr[0]; I use $arr[] = 'x'; this message does not come. Reproduce code: --------------- <?php $loop = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1]+0 : 1000; error_reporting(E_ALL); $arr = array ('x') ; while (--$loop) { $arr[] = $arr[0]; } echo 'count:'.count($arr).'/'.memory_get_usage() . " bytes\n"; ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33551&edit=1
