Bug #74382 [NEW]: Too many phpunit tests causing segmentation fault

From: Date: Thu, 06 Apr 2017 10:47:22 +0000
Subject: Bug #74382 [NEW]: Too many phpunit tests causing segmentation fault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208359@lists.php.net to get a copy of this message
From:             lewis at lewnelson dot com
Operating system: ubuntu 16.04
PHP version:      7.1.3
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Too many phpunit tests causing segmentation fault

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 bug report at https://bugs.php.net/bug.php?id=74382&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=74382&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=74382&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=74382&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=74382&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=74382&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=74382&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=74382&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=74382&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=74382&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=74382&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=74382&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=74382&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=74382&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74382&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=74382&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=74382&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=74382&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74382&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=74382&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=74382&r=mysqlcfg



Thread (11 messages)

« previous php.bugs (#208359) next »