Edit report at https://bugs.php.net/bug.php?id=74382&edit=1
ID: 74382
Comment by: lewis at lewnelson dot com
Reported by: lewis at lewnelson dot com
Summary: Too many phpunit tests causing segmentation fault
Status: Open
Type: Bug
Package: Reproducible crash
Operating System: ubuntu 16.04
PHP Version: 7.1.3
Block user comment: N
Private report: N
New Comment:
Colleague tested using php 7.1.1 using the same virtual machine setup and it worked fine. They
updated to 7.1.3 and had the same error occur.
Previous Comments:
------------------------------------------------------------------------
[2017-04-06 10:47:17] lewis at lewnelson dot com
Description:
------------
Segmentation fault occurring when running phpunit tests. Only appears to be failing when I add
another test class.
Here is the output of running phpunit before adding another test class.
Total test classes: 101
Total test methods: 681
PHPUnit 5.7.12 by Sebastian Bergmann and contributors.
............................................................. 61 / 2390 ( 2%)
............................................................. 122 / 2390 ( 5%)
............................................................. 183 / 2390 ( 7%)
............................................................. 244 / 2390 ( 10%)
............................................................. 305 / 2390 ( 12%)
............................................................. 366 / 2390 ( 15%)
............................................................. 427 / 2390 ( 17%)
............................................................. 488 / 2390 ( 20%)
............................................................. 549 / 2390 ( 22%)
............................................................. 610 / 2390 ( 25%)
............................................................. 671 / 2390 ( 28%)
............................................................. 732 / 2390 ( 30%)
............................................................. 793 / 2390 ( 33%)
............................................................. 854 / 2390 ( 35%)
............................................................. 915 / 2390 ( 38%)
............................................................. 976 / 2390 ( 40%)
............................................................. 1037 / 2390 ( 43%)
............................................................. 1098 / 2390 ( 45%)
............................................................. 1159 / 2390 ( 48%)
............................................................. 1220 / 2390 ( 51%)
............................................................. 1281 / 2390 ( 53%)
............................................................. 1342 / 2390 ( 56%)
............................................................. 1403 / 2390 ( 58%)
............................................................. 1464 / 2390 ( 61%)
............................................................. 1525 / 2390 ( 63%)
............................................................. 1586 / 2390 ( 66%)
............................................................. 1647 / 2390 ( 68%)
............................................................. 1708 / 2390 ( 71%)
............................................................. 1769 / 2390 ( 74%)
............................................................. 1830 / 2390 ( 76%)
............................................................. 1891 / 2390 ( 79%)
............................................................. 1952 / 2390 ( 81%)
............................................................. 2013 / 2390 ( 84%)
............................................................. 2074 / 2390 ( 86%)
............................................................. 2135 / 2390 ( 89%)
............................................................. 2196 / 2390 ( 91%)
............................................................. 2257 / 2390 ( 94%)
............................................................. 2318 / 2390 ( 96%)
............................................................. 2379 / 2390 ( 99%)
........... 2390 / 2390 (100%)
Time: 38.33 seconds, Memory: 196.00MB
OK (2390 tests, 2804 assertions)
Once I add another test class with one new assertion just using $this->assertTrue(true) on a
class which doesn't pair up on any class I have in my source code. Here is the class:
<?php
namespace Trendzer\Platform;
use PHPUnit\Framework\TestCase;
class SomethingTest extends TestCase
{
public function testSomething()
{
$this->assertTrue(true);
}
}
Here is the output now from running phpunit
Total test classes: 102
Total test methods: 682
PHPUnit 5.7.12 by Sebastian Bergmann and contributors.
............................................................. 61 / 2391 ( 2%)
............................................................. 122 / 2391 ( 5%)
............................................................. 183 / 2391 ( 7%)
............................................................. 244 / 2391 ( 10%)
............................................................. 305 / 2391 ( 12%)
............................................................. 366 / 2391 ( 15%)
............................................Segmentation fault
Running with vendor/bin/phpunit --debug flag results in no bug and it executes successfully.
Below is output using gdb
Starting program: /usr/bin/php
/home/developer/hosts/www.trendzer.localdev/application/vendor/bin/phpunit
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
PHPUnit 5.7.12 by Sebastian Bergmann and contributors.
............................................................. 61 / 2391 ( 2%)
............................................................. 122 / 2391 ( 5%)
............................................................. 183 / 2391 ( 7%)
............................................................. 244 / 2391 ( 10%)
............................................................. 305 / 2391 ( 12%)
............................................................. 366 / 2391 ( 15%)
............................................
Program received signal SIGSEGV, Segmentation fault.
0x000055555579a0a2 in _emalloc_56 ()
output of lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
Currently running on a virtual machine using VirtualBox.
At first I thought it might have been a new test that I had added which was specifically causing the
issue, however it seems to happen regardless of where/what I call the new test. The bug also occurs
when I delete an old test and keep the new test, so there are no extra test classes.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74382&edit=1