Runkit segfaults during module shutdown (in cli).
Commenting out this line works for me (current master version): zval_ptr_dtor(&RUNKIT_G(removed_parameter_str_zval));
but I think it's kind unrelated ;)
PHP version: PHP 5.4.6
Behaviour can be observed while running complex PHP tools like PHPUnit or CodeSniffer
handling of reflection objects has been corrected (#30, #40)
Thanks for the report. I've just corrected the issue. Please check this again.
It's still segfaulting. I will compile PHP with debug symbols tomorrow and let you know where exactly PHP with runkit is broken using gdb.
Several times I have also gotten: zend_mm_heap corrupted message
allocate persistent memory blocks for stub-functions #40
properties manipulation was fixed to work with all versions of PHP #40
Sorry for the issue. I had tested with USE_ZEND_ALLOC=0 earlier and that let some bugs get through tests. Now it must work correctly.
Segfaults still occurs. I haven't managed to catch them using gdb using php5 cli with debug symbols.
Running phpunit without code coverage works OK.
Running with coverage segfaults.
PHP 5.4.6-2~precise+1 (cli) (built: Aug 30 2012 14:37:22)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
Adding and removing properties of classes (in PHP 5.4) whose objects …
…have dynamic properties have been corrected. Issues related to memory management have been eliminated. New tests were added. (#40)
Please try to run your tests again with the latest runkit from master branch and Xdebug 2.2.1 (not 2.2.0). If it does not help, please provide the stack-trace on segfault and the code sample reproducing the issue if it is possible. Thanks.
I'm still getting zend_mm_heap error with the latest runkit and PHPUnit 3.7.24 (running without coverage).
I can reproduce the bug with the following code:
class ApiTest extends PHPUnit_Framework_TestCase
public function testNothing()
runkit_import(__DIR__ . '/someStub.php', RUNKIT_IMPORT_OVERRIDE | RUNKIT_IMPORT_CLASSES);
* Comment here
Running phpunit test.php produces zend_mm_heap corrupted error. What's interesting, removing the comment from someStub.php file solves the problem!
in my original issue, removing the comment does not help, unfortunately...
PHP 5.5.3-1+debphp.org~precise+2 (cli) (built: Aug 27 2013 09:15:48)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans