View Issue Details

IDProjectCategoryView StatusLast Update
0001331XdebugUsage problems (Wrong Results)public2016-11-12 16:53
ReportermajkelAssigned Toderick 
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version16.04
Product Version2.4.1 
Target VersionFixed in Version2.5.0RC1 
Summary0001331: Segfault in code coverage
Descriptionhttps://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

Issue History

Date Modified Username Field Change
2016-07-23 11:54 majkel New Issue
2016-07-31 12:35 derick Category Debug client (console) => debugclient (debugging tool)
2016-07-31 12:35 derick Category debugclient (debugging tool) => (No Category)
2016-08-10 15:20 derick Note Added: 0003673
2016-08-10 15:20 derick Category (No Category) => Usage problems (Wrong Results)
2016-08-10 15:20 derick Product Version 2.4.0 => 2.4.1
2016-09-08 18:30 derick Note Added: 0003701
2016-09-09 09:24 ashgenesis Note Added: 0003702
2016-09-09 10:09 derick Note Added: 0003703
2016-09-11 10:56 derick Note Added: 0003705
2016-09-11 10:56 derick Assigned To => derick
2016-09-11 10:56 derick Status new => feedback
2016-09-19 13:06 ashgenesis Note Added: 0003708
2016-10-04 19:21 derick Relationship added has duplicate 0001350
2016-10-07 19:04 derick Status feedback => closed
2016-10-07 19:04 derick Resolution open => fixed
2016-10-07 19:04 derick Fixed in Version => 2.4.2
2016-11-12 16:53 derick Fixed in Version 2.4.2 => 2.5.0RC1