View Issue Details

IDProjectCategoryView StatusLast Update
0001331XdebugUncategorizedpublic2016-11-12 16:53
Reportermajkel Assigned To 
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version16.04
Product Version2.4.1 
Fixed in Version2.5.0RC1 
Summary0001331: Segfault in code coverage
Description

https://bugs.php.net/bug.php?id=72580

TagsNo tags attached.
Operating System
PHP Version7.0.0-7.0.4

Relationships

has duplicate 0001350 resolvedderick Segmentation Fault on Code Coverage 

Activities

derick

2016-08-10 15:20

administrator   ~0003673

Reproduce case:

git clone git@github.com:majkel89/dbase.git
cd dbase
git checkout 735f7862f03d9a3a8a0480ae6432a210692166ba
composer install -o
./vendor/bin/phpunit

derick

2016-09-08 18:30

administrator   ~0003701

ashgenesis, I can reproduce this problem. But there are many many tests, that are just in the way. Can you help trying to figure out which one causes it? It would be great, if you could do this on the shell first before you try:

export USE_ZEND_ALLOC=0

ashgenesis

2016-09-09 09:24

reporter   ~0003702

derick I have found that this is the test which fail

File tests/unit/FormatTest.php
Class FormatTest method testInsertTransaction ligne 867

public function testInsertTransaction() {
    $format = $this->getFormatMock()
        ->getHeader(new Header())
        ->writeHeader(array(), self::never())
        ->serializeRecord()
        ->getFile($this->getFileMock()->new())
        ->new();
    $this->reflect($format)->transaction = true;
    $format->insert(new Record());
}

derick

2016-09-09 10:09

administrator   ~0003703

Yeah, that seems to be the one. I think I know why it happens too. It has to do with the mock and its use of __call.

derick

2016-09-11 10:56

administrator   ~0003705

Think I have this cracked, can you check the following branch to confirm?

https://github.com/derickr/xdebug/tree/issue1331-code-coverage-segfault

ashgenesis

2016-09-19 13:06

reporter   ~0003708

derick I tried you branch and it seem fixing the segfault

./vendor/bin/phpunit tags/v1.0.0~10
PHPUnit 4.7.7 by Sebastian Bergmann and contributors.

Runtime: PHP 7.0.10-1+deb.sury.org~trusty+1 with Xdebug 2.4.1-dev
Configuration: /var/www/dev/dbase/phpunit.xml

............................................................... 63 / 318 ( 19%)
............................................................... 126 / 318 ( 39%)
............................................................... 189 / 318 ( 59%)
............................................................... 252 / 318 ( 79%)
............................................................... 315 / 318 ( 99%)
...

Time: 8.61 seconds, Memory: 14.00MB

OK (318 tests, 611 assertions)

Generating code coverage report in HTML format ... done

No more segfault with your branch.

Thanks