ID: 50519
Updated by: johannes@php.net
Reported By: robin dot kunde at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 5.3.1
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
sounds like #43918
Previous Comments:
------------------------------------------------------------------------
[2009-12-18 16:17:35] robin dot kunde at gmail dot com
Description:
------------
After setting a custom class based error handler, then using
DomDocument, then setting the same error handler again, without
resetting it first, PHP segfaults during shutdown. A function based
error handler doesn't cause the problem. Executed the three commands in
any other order doesn't cause the problem.
tested with:
php-5.3.1
php5.3-200912181330 (./configure --enable-debug)
libxml2 (2.7.5)
Reproduce code:
---------------
<?php
set_error_handler(array('ErrorHandler', 'handlePhpError'));
new DomDocument();
set_error_handler(array('ErrorHandler', 'handlePhpError'));
class ErrorHandler
{
static function handlePhpError($errno, $errstr, $errfile, $errline)
{
return true;
}
}
>?
Expected result:
----------------
nothing
Actual result:
--------------
segmentation fault
backtrace:
Program received signal SIGSEGV, Segmentation fault.
zval_mark_grey (pz=0x86fafec) at
/home/xxx/src/php5.3-200912181330/Zend/zend_gc.c:360
360 pz = *(zval**)p->pData;
(gdb) bt
#0 zval_mark_grey (pz=0x86fafec) at
/home/xxx/src/php5.3-200912181330/Zend/zend_gc.c:360
#1 0x082f3aed in gc_mark_roots () at
/home/xxx/src/php5.3-200912181330/Zend/zend_gc.c:417
#2 gc_collect_cycles () at
/home/xxx/src/php5.3-200912181330/Zend/zend_gc.c:628
#3 0x082d85f5 in zend_deactivate () at
/home/xxx/src/php5.3-200912181330/Zend/zend.c:900
#4 0x08287953 in php_request_shutdown (dummy=0x0) at
/home/xxx/src/php5.3-200912181330/main/main.c:1606
#5 0x08357956 in main (argc=2, argv=0xbffff4c4) at
/home/xxx/src/php5.3-200912181330/sapi/cli/php_cli.c:1373
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50519&edit=1