Seg fault while running phpunit with code coverage

php

#1

Environment: PHP 7.0.0RC7

ubuntu@box857:~$ php --version
PHP 7.0.0RC7 (cli) (built: Nov 20 2015 13:37:25) ( NTS )
Copyright © 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright © 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright © 1999-2015, by Zend Technologies
with Xdebug v2.4.0beta1, Copyright © 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:

dependencies:
  pre:
    # enable Xdebug
    - sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini
    # update Xdebug (hotfix)
    - |
      php --version
      wget https://xdebug.org/files/xdebug-2.4.0.tgz
      tar -xvzf xdebug-2.4.0.tgz
      cd xdebug-2.4.0
      phpize
      ./configure
      make
      cp modules/xdebug.so /home/ubuntu/.phpenv/versions/7.0.0RC7/lib/php/extensions/no-debug-non-zts-20151012
      php --version

#2

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:


#3

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 :

dependencies:
  pre:
    - pecl install xdebug

Hope this helps.


#4