Phpunit segfault

I have a weird error where PHPUnit is segfaulting in the middle of some unit tests for a specific project. If I enable ssh and log in and run the exact command from my circle.yml file, the segfault does not happen. Also, the unit tests where the segfault happen are part of a dependent project that is tested separately and as part of other projects, and in all cases the tests pass without segfault.

I’m running ubuntu 12.04 and php 5.3.10 (yeah, I know).

I have tried disabling xdebug by deleting its ini file and increasing the memory limit:

- rm ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini - echo "memory_limit = 256M" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/memory.ini

How is the environment in which the test command is run different from logging in via ssh and running the exact same command? Any hints that might help me solve this problem?

Shouldn’t be all that different. How long is the test taking to run? The build?

An update … I got the tests to run by disabling garbage collection in php using

echo "zend.enable_gc = Off" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/gc.ini

The tests fail quite early on - a typical test run is 30 minutes with about 7 minutes of install/configure at the beginning. The segfault happens maybe 30 seconds into the actual tests, so essentially right at the beginning.

1 Like