Skip to content

MSHUTDOWN segfaults #40

Closed
wendigo opened this Issue Sep 26, 2012 · 7 comments

3 participants

@wendigo
wendigo commented Sep 26, 2012

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

@zenovich
Owner

Thanks for the report. I've just corrected the issue. Please check this again.

@wendigo
wendigo commented Sep 26, 2012

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.

@wendigo
wendigo commented Sep 26, 2012

Several times I have also gotten: zend_mm_heap corrupted message

@zenovich
Owner

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.

@wendigo
wendigo commented Oct 1, 2012

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

@zenovich zenovich added a commit that referenced this issue Oct 3, 2012
@zenovich 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)
cbcfa9b
@zenovich
Owner
zenovich commented Oct 3, 2012

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.

@zenovich zenovich closed this Oct 13, 2012
@pbudzon
pbudzon commented Sep 4, 2013

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:

File test.php:

<?php
class ApiTest extends PHPUnit_Framework_TestCase
{
    public function testNothing()
    {
        runkit_import(__DIR__ . '/someStub.php', RUNKIT_IMPORT_OVERRIDE | RUNKIT_IMPORT_CLASSES);
        return true;
    }
}

File someStub.php:

<?php
/**
 * Comment here
 */
class Whatever
{}

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...

My system:
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

PHPUnit 3.7.24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.