[PHP-DEV] Bug #10911: Accessing null string as array in loop causes infinite spooling. From: sr2899 <email protected>
Date: 05/16/01

From: sr2899 <email protected>
Operating system: linux
PHP version: 4.0 Latest CVS (2001-05-16)
PHP Bug Type: Scripting Engine problem
Bug description: Accessing null string as array in loop causes infinite spooling.

Accessing null string as array in loop causes infinite spooling.

The following code causes php to loop forever. It appears a memory leak unsets the $i variable, although I'm not certain. If allowed to run long enough, error logs appear, such as:
child pid 14467 exit signal Segmentation fault (11)
FATAL: emalloc(): Unable to allocate 1313818981 bytes

<pre>
<?
$myarray = "";
for ($i = 1; $i <= 5; $i++) {
        $v = (isset($myarray[1][$i]['value']))?($myarray[1][$i]['value']):'';
        print $i."...".$v."...\n";
        }
?>
</pre>

Output is as follows
------------
HTTP/1.1 200 OK
Date: Wed, 16 May 2001 22:20:07 GMT
Server: Apache/1.3.19 (Unix) mod_ssl/2.8.3 OpenSSL/0.9.6a
Connection: close
Content-Type: text/html

<pre>
1......
2......
......
......
......
......

------------
After that, it repeats forever...

-- 
Edit Bug report at: http://bugs.php.net/?id=10911&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>