symfony: Symfony 4.4.0-BETA2: Segmentation fault with PHPUnit 6.5.14

Symfony version(s) affected: 4.4.0-BETA2

PHP Version: 7.2.17

Description
PHPunit crashed with a segmentation fault.

[21:50:49] coil@Mac-mini-de-COil.local:/Users/coil/Sites/strangebuzz.com$ bin/phpunit --stop-on-failure
#!/usr/bin/env php
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.
Testing Project Test Suite
..fish: 'bin/phpunit --stop-on-failure' terminated by signal SIGSEGV (Address boundary error)

Or when launching with my MakeFile:

[22:02:18] coil@Mac-mini-de-COil.local:/Users/coil/Sites/strangebuzz.com$ make test
bin/phpunit --stop-on-failure
#!/usr/bin/env php
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

Testing Project Test Suite
..make: *** [test] Segmentation fault: 11

Additional context
The site looks to work without problem, but as I can’t run all the tests I can’t be sure. It’s seems that failing test-suites contains loops. No error when accessing the URLs with the browser.

May be related : phpunit-segmentation-fault-11

If you need more information, tell me. COil 🙂

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 29 (23 by maintainers)

Commits related to this issue

Most upvoted comments

Does #34580 fix the issue? Could anyone give it a try?

Does #34580 fix the issue? Could anyone give it a try?

I can confirm that it mitigates the problem. I have added "symfony/http-kernel": "4.4.x-dev@dev", to my composer.json. I have only checked one Symfony 4.4 project, will validate with the other one shortly.

Can you please try with this change?

--- a/src/Kernel.php
+++ b/src/Kernel.php
@@ -34,6 +34,7 @@ class Kernel extends BaseKernel
     {
         $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
         $container->setParameter('container.dumper.inline_class_loader', true);
+        $container->setParameter('container.dumper.inline_factories', true);
         $confDir = $this->getProjectDir().'/config';
 
         $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');

Dramatically! Our test suite here dropped from 26 minutes runtime and 1,000 MB of memory to a mere 2 minutes and 176.5 MB! Even with PCOV activated for code coverage, it takes only 2.3 minutes for 191 tests and 1,169 assertions now.

Edit: I should point out that it was only slow immediately after the upgrade to Symfony 4.4.0. So it’s back to normal speed. 😉

Can you please try with this change?

--- a/src/Kernel.php
+++ b/src/Kernel.php
@@ -34,6 +34,7 @@ class Kernel extends BaseKernel
     {
         $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
         $container->setParameter('container.dumper.inline_class_loader', true);
+        $container->setParameter('container.dumper.inline_factories', true);
         $confDir = $this->getProjectDir().'/config';
 
         $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');

That solved the problem for me, in PHP7.3 with brew

I also have this “slowness” problem. But only when the container need to be recompiled (after a change in services.yml for example). At the second run, the tests are fast as they used to.