Bug #10911 Updated: Accessing null string as array in loop causes infinite spooling.
| From: | zeev@php.net | Date: | Thu, 21 Jun 2001 16:14:21 +0000 |
| Subject: | Bug #10911 Updated: Accessing null string as array in loop causes infinite spooling. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57564@lists.php.net to get a copy of this message | ||
ID: 10911
Updated by: zeev
Reported By: sr2899@hotmail.com
Old-Status: Open
Status: Closed
Bug Type: Scripting Engine problem
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
Fixed in the latest CVS. Thanks for the report!
Previous Comments:
---------------------------------------------------------------------------
[2001-06-05 17:31:04] sr2899@hotmail.com
I noticed bug id #11218 is almost definately the same bug... the key is that we're accessing an
array, looking for indexes where the whole layer of indexes is unset...
http://www.php.net/bugs.php?id=11218
The submitter of bug 11218 said:
>I just ran your test script on my system from the
>command line. Obtained the same behavior you reported.
>My system is NT 4.0 SP 6a, PHP 4.0.5.
---------------------------------------------------------------------------
[2001-05-16 18:36:16] sr2899@hotmail.com
Whoops I accidentally selected latest CVS when I should've said 4.0.5
---------------------------------------------------------------------------
[2001-05-16 18:28:54] sr2899@hotmail.com
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...
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10911&edit=2