From:             csaba at alum dot mit dot edu
Operating system: Win XP
PHP version:      5.1.0RC1
PHP Bug Type:     COM related
Bug description:  empty array onto COM object blows up

Description:
------------
putting an empty array onto a COM object leads to severe reactions from
the system.  Memory usage escalates dramatically (my system showed 1.6G),
the machine slows to a crawl even though system idle does not reflect it,
and it has crashed FF, too, when I had many windows open.

Running this from CLI php.exe produces a noticable delay, but the really
severe reaction comes when running it as a web page.

Csaba Gabor from Vienna

Reproduce code:
---------------
<?php
$dict = new COM("Scripting.Dictionary");
$dict->add('foo', array());
print sizeof($dict['foo']);                // bug: large #
$dict->add('bar', array(23));
print " " . sizeof($dict['bar']) . " \n";  // OK: 1

$ie = new COM("InternetExplorer.Application");
$ie->navigate("about:blank");   // to get a document object
$window=$ie->document->parentWindow;
$window->execScript("window.myArray=false");  //placeholder
$window->myArray = array();
print sizeof($window->myArray);           // bug: large #
$window->myArray = array(23);
print " " . sizeof($window->myArray);     // OK: 1
?>

Expected result:
----------------
On the output for the empty arrays, I should get 0 and not some number in
the millions.  But especially, running the code above should not lock up
the system.
The last two statements of each of the two code sections are showing
correct behaviour and are not part of the bug.


-- 
Edit bug report at http://bugs.php.net/?id=34272&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34272&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34272&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34272&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34272&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34272&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34272&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34272&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34272&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34272&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34272&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34272&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34272&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34272&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34272&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34272&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34272&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34272&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34272&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34272&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34272&r=mysqlcfg

Reply via email to