Seg fault while running phpunit with code coverage

Environment: PHP 7.0.0RC7

ubuntu@box857:~$ php --version
PHP 7.0.0RC7 (cli) (built: Nov 20 2015 13:37:25) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.4.0beta1, Copyright (c) 2002-2015, by Derick Rethans

While running phpunit with certain forms of code coverage, phpunit seg faults and the build fails.

Seg fault error does not display in the web ui, but is visible while inside the build box via ssh.

Upon investigation, the culprit looks to be an older copy of XDebug (v2.4.0beta1). Changelogs between this version and now have identified 2 instances (RC1 & RC2) of fixing segmentation faults from coverage reporting.

Additionally, XDebug announced today the official release of v2.4.0.

I would like to request circleci’s php environment to come with this new version of XDebug. Bonus points for a newer php 7 environment too.

This is my hideous fix until then:

    # enable Xdebug
    - sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini
    # update Xdebug (hotfix)
    - |
      php --version
      tar -xvzf xdebug-2.4.0.tgz
      cd xdebug-2.4.0
      cp modules/ /home/ubuntu/.phpenv/versions/7.0.0RC7/lib/php/extensions/no-debug-non-zts-20151012
      php --version
1 Like

What version of Ubuntu are you using?

I also agree, just to add my two cents, if it might help convince CircleCI teams to update their ubuntu machines :slight_smile:

1 Like

Got a segfault too with php5.6.17/xdebug2.3.x ;
Your dirty fix got me on the right track. But I choose to use pecl :

    - pecl install xdebug

Hope this helps.