ID:               24773
 Updated by:       [EMAIL PROTECTED]
 Reported By:      info at tphnet dot com
-Status:           Closed
+Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: *
-PHP Version:      4CVS, 5CVS
+PHP Version:      4CVS
 New Comment:

Fixed in HEAD, not in PHP_4_3 branch.



Previous Comments:
------------------------------------------------------------------------

[2003-12-03 14:44:44] [EMAIL PROTECTED]

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

[2003-07-23 13:55:13] [EMAIL PROTECTED]

Here is the sample script that causes the crash:
<?php
        $array = '1';
        unset($array[1][2][3]);
?>

------------------------------------------------------------------------

[2003-07-23 13:49:07] info at tphnet dot com

Description:
------------
When trying to unset() a multidimensional array which actually is an
integer, PHP will crash. Windows signals the program has generated a
fatal error and will be shutdown.

I had an array which looked something like this: $array[1][2][3] =
'value' and I used unset($array[1][2][3]) to clear the value of this
element of my array.
At some point in my script I accidently replaced the value of $array
with a simple integer (e.g. $array = 'value'), so $array wasn't an
array anymore.
If i then tried to unset($array[1][2][3]), PHP would crash (after a few
seconds of running @ 100% cpu). I know the code is faulty, I don't
think it should be able to crash PHP...

I'm using Apache 2.0.45 with PHP as a module, but the crash also
occours when using the client version (php-cli.php on windows) from the
command prompt.

Note: The crash only occours when using multidimensional arrays.

Reproduce code:
---------------
<?

$array = 'test';

unset($array["lvl1"]["lvl2"]["b"]);

?>

Expected result:
----------------
When Using Apache:
Windows signals apache has generated a fatal error and will be closed.
Apache automatically restarts and resumes loading the webpage, thus
crashing again and getting stuck in an endless crashing loop (until you
close the browser).
When Using PHP CLI:
Windows signals PHP has generated a fatal error and will be closed,
script execution is terminated and you are returned to the command
prompt.

Actual result:
--------------
AppName: php.exe
AppVer: 4.3.2.2
ModName: php4ts.dll
ModVer: 4.3.2.2
Offset: 000cf358

I've also saved the log windows generated when the crash occoured. It's
kinda long (in XML) and I don't know which (if any) part you require,
so let me know if you need.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24773&edit=1

Reply via email to