Bug #73667 [NEW]: Segfault when using phpunit with large test suites

From: Date: Tue, 06 Dec 2016 10:24:30 +0000
Subject: Bug #73667 [NEW]: Segfault when using phpunit with large test suites
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205802@lists.php.net to get a copy of this message
From:             ilya at antipenko dot pp dot ua
Operating system: Ubuntu 14.04.5/12.04
PHP version:      7.0.13
Package:          Reflection related
Bug Type:         Bug
Bug description:Segfault when using phpunit with large test suites

Description:
------------
Hello.

I'm getting this segfault on travis-ci (php 7.0.13) when I run unit
tests (phpunit 4.8/5.2).
Unfortunately, it's a private repo and I can't reproduce this segfault
with synthetic test.

Also, this segfault disappears after using additional phpunit options
(like --testdox)

Also, we are using
https://github.com/mybuilder/phpunit-accelerator/blob/master/src/TestListener.php#L46
to cleanup test after it finished. Probably, it can cause lots of
reflection usages which causes memory corruption.

I know, there is a bit of information, but I hope we can found and fix
it together.

$ php --version
PHP 7.0.13 (cli) (built: Nov 22 2016 16:40:26) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

Actual result:
--------------
(gdb) bt
#0  zend_mm_alloc_small (bin_num=<optimized out>, heap=<optimized out>,
size=<optimized out>) at
/tmp/php-build/source/7.0.13/Zend/zend_alloc.c:1295
#1  _emalloc_56 () at
/tmp/php-build/source/7.0.13/Zend/zend_alloc.c:2369
#2  0x00000000009495b2 in ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER
(execute_data=0x7fffee01c1a0) at
/tmp/php-build/source/7.0.13/Zend/zend_vm_execute.h:35034
#3  0x00000000009152a0 in execute_ex (ex=<optimized out>) at
/tmp/php-build/source/7.0.13/Zend/zend_vm_execute.h:417
#4  0x00000000008c2ea0 in zend_call_function (fci=0x7fffffff9bf0,
fci_cache=0x7fffffff9c40) at
/tmp/php-build/source/7.0.13/Zend/zend_execute_API.c:858
#5  0x000000000071413b in zim_reflection_method_invokeArgs
(execute_data=<optimized out>, return_value=0x7fffee019d20) at
/tmp/php-build/source/7.0.13/ext/reflection/php_reflection.c:3346
#6  0x000000000095de47 in ZEND_DO_FCALL_SPEC_HANDLER
(execute_data=0x7fffee019b50) at
/tmp/php-build/source/7.0.13/Zend/zend_vm_execute.h:842
#7  0x00000000009152a0 in execute_ex (ex=<optimized out>) at
/tmp/php-build/source/7.0.13/Zend/zend_vm_execute.h:417
#8  0x000000000096d967 in zend_execute (op_array=<optimized out>,
return_value=<optimized out>) at
/tmp/php-build/source/7.0.13/Zend/zend_vm_execute.h:458
#9  0x00000000008d27a4 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /tmp/php-build/source/7.0.13/Zend/zend.c:1427
#10 0x0000000000865576 in php_execute_script
(primary_file=0x7fffffffc1c0) at
/tmp/php-build/source/7.0.13/main/main.c:2494
#11 0x000000000096f6ce in do_cli (argc=7, argv=0x12740d0) at
/tmp/php-build/source/7.0.13/sapi/cli/php_cli.c:974
#12 0x00000000004545f5 in main (argc=7, argv=0x12740d0) at
/tmp/php-build/source/7.0.13/sapi/cli/php_cli.c:1344
(gdb) 


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



Thread (4 messages)

« previous php.bugs (#205802) next »