ID: 32252
Updated by: [EMAIL PROTECTED]
Reported By: shulmanb at il dot ibm dot com
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5.*
Assigned To: helly
New Comment:
The first problem here is that the negative key results in incomplete
initialized zvals internally *before* even calling offsetSet().
Previous Comments:
------------------------------------------------------------------------
[2005-03-09 14:38:38] shulmanb at il dot ibm dot com
Description:
------------
In some cases, when offsetSet throws an exception a segfault occurs.
This does not happen when compiled with --enable-debug.
Note that if the index passed to $list is positive or a string, not
segfault occurs.
Reproduce code:
---------------
class a implements ArrayAccess
{
function offsetExists ($offset) { return false; }
function offsetGet ($offset) { return null; }
function offsetSet ($offset, $value) { throw new Exception ("Ooops");
}
function offsetUnset ($offset) {}
}
function test()
{
$list = new a();
try {
$list[-1] = 123;
} catch (Exception $e) { }
return true;
}
print test();
Expected result:
----------------
The output should be "1".
Actual result:
--------------
Segmentation fault.
The stack trace reported in Visual Studio, using the latest snapshot
and debug pack is:
php5ts.dll!shutdown_memory_manager(int silent=0, int full_shutdown=0,
void * * * tsrm_ls=0x00364b38) Line 490 + 0xb C
php5ts.dll!php_request_shutdown(void * dummy=0x00000000) Line 1225 +
0x2f C
msvcrt.dll!77c37bbe()
user32.dll!77d5f160()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32252&edit=1