View Issue Details

IDProjectCategoryView StatusLast Update
0001246XdebugUncategorizedpublic2016-06-06 21:25
Reporterrsmith@golumigent.com Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSCentOSOS Version7
Product Version2.4.0rc3 
Fixed in Version2.4.1 
Summary0001246: Seg fault when running PHPUnit with code coverage
Description

I have PHP 7.0.2 installed and when running PHPUnit (v4.8.21) with code coverage, I get a segmentation fault. As soon as I run without code coverage, the tests run fine.

Steps To Reproduce

PHP 7.0.2 installed with:

./configure --with-apxs2=/usr/bin/apxs \
--with-mysqli --with-imap --with-imap-ssl \
--with-kerberos --with-pdo-mysql --with-openssl --with-curl \
--enable-pcntl --with-libdir=lib64 --with-zlib --enable-zip \
--enable-mbstring --enable-intl --with-readline --with-xsl \
--with-gd --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 \
--with-gmp --enable-bcmath --enable-opcache \
--with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d

XDebug extension enabled "zend_extension=xdebug.so"

TagsNo tags attached.
Attached Files
gdb_run.txt (1,663 bytes)   
[vagrant@papi papi-app]$ gdb --args php vendor/bin/phpunit --colors --verbose --configuration tests/unit/phpunit.xml --log-junit="tests/unit/report.xml" --coverage-html="tests/unit/reports/coverage" --testdox-html="tests/unit/reports/testdox/index.html" --filter shouldGenerateBaseCoreOutput
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/php...(no debugging symbols found)...done.
Missing separate debuginfos, use: debuginfo-install php70w-cli-7.0.5-1.w6.x86_64
(gdb) r
Starting program: /usr/bin/php vendor/bin/phpunit --colors --verbose --configuration tests/unit/phpunit.xml --log-junit=tests/unit/report.xml --coverage-html=tests/unit/reports/coverage --testdox-html=tests/unit/reports/testdox/index.html --filter shouldGenerateBaseCoreOutput
[Thread debugging using libthread_db enabled]
PHPUnit 4.1.6 by Sebastian Bergmann.

Configuration read from /etc/alternatives/papi-app/tests/unit/phpunit.xml


Program received signal SIGSEGV, Segmentation fault.
0x00007fffedd13373 in xdebug_build_fname_from_oparray (tmp=0x7fffffff9000, opa=0x7fffe558b2a0) at /home/vagrant/xdebug-2.4.0/xdebug_code_coverage.c:812
812			if (strcmp(STR_NAME_VAL(opa->function_name), "{closure}") == 0) {
gdb_run.txt (1,663 bytes)   
Operating SystemCentOS 7.0.2
PHP Version7.0.0-7.0.4

Activities

derick

2016-01-11 22:13

administrator   ~0003395

Could you please try Xdebug from github's master branch? I fixed a few things. If that doesn't fix it, I will need to have a nice backtrace (hints on how to make them: https://bugs.php.net/bugs-generating-backtrace.php)

rsmith@golumigent.com

2016-01-11 22:25

reporter   ~0003398

I cloned the repo and am using RC4-dev, but I still get the segfault. I'll work on trying to get a backtrace to you tomorrow; I've never done it so thanks for the doc.

derick

2016-01-11 22:47

administrator   ~0003400

That's all right. The easiest is probably to run your example with this:

gdb --args php which phpunit .

and then type "run"

For this to work, you do need debugging symbols in PHP enabled - possible by installing the php7-dev or php7-devel packages if you use PHP 7 from a repository. If you compiled it yourself, make sure you have --enable-debug in PHP's configure line.

Ping me on IRC (FreeNode/#xdebug) if you want tomorrow. I'm on GMT.

derick

2016-01-12 09:08

administrator   ~0003410

zaq178miami, your issue is described in 0001239 - please note that this bug was for PHP 7.0.X, whereas yours is specifically for PHP 7.1.X. I've copied our comments over, and will delete them from this report, as they are unrelated.

rsmith@golumigent.com

2016-01-12 14:35

reporter   ~0003415

derick, here is the output from gdb:

[root@localhost ryan]# gdb php core-php.18294
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> [^]
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>... [^]
Reading symbols from /usr/local/bin/php...done.
[New LWP 18294]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `php ../vendor/bin/phpunit ../module/Product/tests/ProductTest/Entity/ProductPri'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f270886174b in xdebug_set_in_ex (set=0x2904260, position=4294966624, noisy=1) at /home/ryan/xdebug/xdebug_set.c:72
72 return (*byte & (1 << bit));
Missing separate debuginfos, use: debuginfo-install audit-libs-2.4.1-5.el7.x86_64 cyrus-sasl-lib-2.1.26-19.2.el7.x86_64 glibc-2.17-106.el7_2.1.x86_64 gmp-6.0.0-12.el7_1.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.13.2-10.el7.x86_64 libc-client-2007f-4.el7.1.x86_64 libcom_err-1.42.9-7.el7.x86_64 libcurl-7.29.0-25.el7.centos.x86_64 libgcc-4.8.5-4.el7.x86_64 libgcrypt-1.5.3-12.el7_1.1.x86_64 libgpg-error-1.12-3.el7.x86_64 libicu-50.1.2-15.el7.x86_64 libidn-1.28-4.el7.x86_64 libjpeg-turbo-1.2.90-5.el7.x86_64 libpng-1.5.13-7.el7_2.x86_64 libselinux-2.2.2-6.el7.x86_64 libssh2-1.4.3-10.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64 libxml2-2.9.1-6.el7_2.2.x86_64 libxslt-1.1.28-5.el7.x86_64 ncurses-libs-5.9-13.20130511.el7.x86_64 nspr-4.10.8-2.el7_1.x86_64 nss-3.19.1-18.el7.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 nss-util-3.19.1-4.el7_1.x86_64 openldap-2.4.40-8.el7.x86_64 openssl-libs-1.0.1e-51.el7_2.1.x86_64 pam-1.1.8-12.el7_1.1.x86_64 pcre-8.32-15.el7.x86_64 readline-6.2-9.el7.x86_64 xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_6

And then the backtrace:

#0 0x00007f270886174b in xdebug_set_in_ex (set=0x2904260, position=4294966624, noisy=1) at /home/ryan/xdebug/xdebug_set.c:72
#1 0x00007f270884d9db in xdebug_analyse_branch (opa=0x7f2708262f48, position=4294966624, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:681
0000002 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=462, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000003 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=440, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000004 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=436, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000005 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=435, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000006 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=431, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000007 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=429, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000008 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=415, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000009 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=410, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000010 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=384, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000011 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=383, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000012 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=379, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000013 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=377, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000014 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=363, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000015 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=358, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000016 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=340, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000017 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=339, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000018 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=335, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000019 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=332, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000020 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=318, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000021 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=313, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000022 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=237, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000023 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=236, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
---Type <return> to continue, or q <return> to quit---
0000024 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=234, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000025 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=228, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000026 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=116, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000027 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=115, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000028 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=113, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000029 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=69, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000030 0x00007f270884db16 in xdebug_analyse_branch (opa=0x7f2708262f48, position=61, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:713
0000031 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=60, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000032 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=50, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000033 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=39, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000034 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=37, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
#35 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=27, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000036 0x00007f270884da9f in xdebug_analyse_branch (opa=0x7f2708262f48, position=19, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:705
0000037 0x00007f270884dcf3 in xdebug_analyse_oparray (opa=0x7f2708262f48, set=0x2904260, branch_info=0x0) at /home/ryan/xdebug/xdebug_code_coverage.c:763
0000038 0x00007f270884e03c in prefill_from_oparray (filename=0x7f270081dd88 "/home/ryan/projects/ips/1/vendor/phpunit/phpunit/src/Util/XML.php", op_array=0x7f2708262f48) at /home/ryan/xdebug/xdebug_code_coverage.c:848
0000039 0x00007f270884e1fe in prefill_from_function_table (opa=0x7f2708262f48) at /home/ryan/xdebug/xdebug_code_coverage.c:890
0000040 0x00007f270884e2d6 in prefill_from_class_table (class_entry=0x596cd10, num_args=1, args=0x7ffd1b172d90, hash_key=0x7ffd1b172d80) at /home/ryan/xdebug/xdebug_code_coverage.c:918
0000041 0x0000000000a09277 in zend_hash_apply_with_arguments (ht=0x1d80ff0, apply_func=0x7f270884e205 <prefill_from_class_table>, num_args=1) at /home/ryan/php-src-php-7.0.2/Zend/zend_hash.c:1580
0000042 0x00007f270884e3bf in xdebug_prefill_code_coverage (op_array=0x7f270833fef8) at /home/ryan/xdebug/xdebug_code_coverage.c:937
0000043 0x00007f270884e3e7 in xdebug_code_coverage_start_of_function (op_array=0x7f270833fef8) at /home/ryan/xdebug/xdebug_code_coverage.c:944
0000044 0x00007f2708848ca3 in xdebug_execute_ex (execute_data=0x7f270f214910) at /home/ryan/xdebug/xdebug.c:1843
0000045 0x0000000000a4f091 in ZEND_DO_FCALL_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:800
0000046 0x0000000000a518dc in ZEND_USER_OPCODE_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:1589
0000047 0x0000000000a4e0d4 in execute_ex (ex=0x7f270f214740) at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:414
---Type <return> to continue, or q <return> to quit---
0000048 0x00007f2708848d79 in xdebug_execute_ex (execute_data=0x7f270f214740) at /home/ryan/xdebug/xdebug.c:1874
#49 0x0000000000a4f091 in ZEND_DO_FCALL_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:800
0000050 0x0000000000a518dc in ZEND_USER_OPCODE_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:1589
#51 0x0000000000a4e0d4 in execute_ex (ex=0x7f270f214550) at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:414
0000052 0x00007f2708848d79 in xdebug_execute_ex (execute_data=0x7f270f214550) at /home/ryan/xdebug/xdebug.c:1874
0000053 0x0000000000a4f091 in ZEND_DO_FCALL_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:800
0000054 0x0000000000a518dc in ZEND_USER_OPCODE_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:1589
0000055 0x0000000000a4e0d4 in execute_ex (ex=0x7f270f214400) at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:414
0000056 0x00007f2708848d79 in xdebug_execute_ex (execute_data=0x7f270f214400) at /home/ryan/xdebug/xdebug.c:1874
0000057 0x0000000000a4f091 in ZEND_DO_FCALL_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:800
0000058 0x0000000000a518dc in ZEND_USER_OPCODE_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:1589
0000059 0x0000000000a4e0d4 in execute_ex (ex=0x7f270f214290) at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:414
0000060 0x00007f2708848d79 in xdebug_execute_ex (execute_data=0x7f270f214290) at /home/ryan/xdebug/xdebug.c:1874
0000061 0x0000000000a4f091 in ZEND_DO_FCALL_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:800
0000062 0x0000000000a518dc in ZEND_USER_OPCODE_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:1589
0000063 0x0000000000a4e0d4 in execute_ex (ex=0x7f270f214160) at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:414
0000064 0x00007f2708848d79 in xdebug_execute_ex (execute_data=0x7f270f214160) at /home/ryan/xdebug/xdebug.c:1874
0000065 0x0000000000a4f091 in ZEND_DO_FCALL_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:800
0000066 0x0000000000a518dc in ZEND_USER_OPCODE_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:1589
0000067 0x0000000000a4e0d4 in execute_ex (ex=0x7f270f2140c0) at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:414
0000068 0x00007f2708848d79 in xdebug_execute_ex (execute_data=0x7f270f2140c0) at /home/ryan/xdebug/xdebug.c:1874
0000069 0x0000000000a4f091 in ZEND_DO_FCALL_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:800
0000070 0x0000000000a518dc in ZEND_USER_OPCODE_SPEC_HANDLER () at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:1589
0000071 0x0000000000a4e0d4 in execute_ex (ex=0x7f270f214030) at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:414
---Type <return> to continue, or q <return> to quit---
0000072 0x00007f2708848d79 in xdebug_execute_ex (execute_data=0x7f270f214030) at /home/ryan/xdebug/xdebug.c:1874
0000073 0x0000000000a4e1e6 in zend_execute (op_array=0x7f270f286000, return_value=0x0) at /home/ryan/php-src-php-7.0.2/Zend/zend_vm_execute.h:458
0000074 0x00000000009f40e3 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/ryan/php-src-php-7.0.2/Zend/zend.c:1427
0000075 0x0000000000967165 in php_execute_script (primary_file=0x7ffd1b176d40) at /home/ryan/php-src-php-7.0.2/main/main.c:2471
0000076 0x0000000000ab1df0 in do_cli (argc=3, argv=0x1d80bd0) at /home/ryan/php-src-php-7.0.2/sapi/cli/php_cli.c:974
0000077 0x0000000000ab2dac in main (argc=3, argv=0x1d80bd0) at /home/ryan/php-src-php-7.0.2/sapi/cli/php_cli.c:1345

driusan

2016-01-20 16:37

reporter   ~0003429

This is may be the same issue as 0001257, since phpunit uses XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE as options to xdebug_start_code_coverage

interfaSys

2016-01-22 11:26

reporter   ~0003432

Another full trace, when running on Travis-CI
https://travis-ci.org/owncloud/gallery/builds/103986265#L1541

derick

2016-02-08 21:04

administrator   ~0003452

I am reasonably certain this is now fixed in 2.4.0RC4 - Can you please try this?

rsmith@golumigent.com

2016-02-08 21:38

reporter   ~0003462

I just downloaded and enabled 2.4.0RC4 and still received the seg_fault.

interfaSys

2016-02-08 21:50

reporter   ~0003463

Haven't tried on 7.0.3, but RC4 did not fix it on 7.0.2 on Travis.

derick

2016-02-08 22:00

administrator   ~0003464

Thanks rsmith. Can you make another backtrace like you did before, but then also add the following things.

Find the frame number of the lowest xdebug_analyse_branch call (#1 in your example).

Run at the GDB prompt (change the number to what you found):
frame 1
p opa
frame 2 (again, change it to one higher than before)
p
opa

Also find the first "prefill_from_oparray" number, and provide me with the file it references (in the original GDB output from above, /home/ryan/projects/ips/1/vendor/phpunit/phpunit/src/Util/XML.php)

cheers,
Derick

derick

2016-02-27 15:59

administrator   ~0003525

Ping?

rsmith@golumigent.com

2016-02-29 13:20

reporter   ~0003536

Sorry, this happens on my work VM and don't really have the time while I'm at work to get a backtrace. If I get a free moment, I will get you the backtrace. At this point, I'm continuing to just disable the extension to run PHPUnit tests.

interfaSys

2016-02-29 17:35

reporter   ~0003537

Last edited: 2016-02-29 17:35

@derick - I think the information you're looking for is available in the trace I provided, even though the trace was not captured interactively.

derick

2016-03-04 15:38

administrator   ~0003543

@interfaSys - Do you have opcache enabled? Can you try disabling it to see if it changes things?

interfaSys

2016-03-05 19:40

reporter   ~0003562

Spot on. Opcache is enabled on Travis, even though it's not mentioned anywhere in their documentation.
After disabling it PHP doesn't segfault any more.

Generating coverage does break some tests though (error 500), so I'll have to see why this is happening and if it is linked to xdebug.

And there is also an issue with the total line count.
Coverage on PHP 5.6: 1270/1276
Coverage on PHP 7.0: 1055/1055
Not sure where the other 221 lines went, but it could be because xdebug doesn't offer coverage for everything yet on PHP7?

rsmith@golumigent.com

2016-03-07 13:52

reporter   ~0003565

@derick, opcache was enabled for me as well. Disabling it allowed me to run my tests with coverage as expected. Is XDebug incompatible with opcache?

onedev_link

2016-03-24 10:45

reporter   ~0003573

PHP 7.0.4 (cli) (built: Mar 5 2016 00:55:49) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans

After method xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); when I call nonexistent method I get Segmentation fault (core dumped).

But without XDEBUG_CC_UNUSED it's OK.

onedev_link

2016-04-22 11:00

reporter   ~0003585

As a temporary solution i set opcache.optimization_level param to 0x00000000 for code coverage.

ini_set('opcache.optimization_level', '0x00000000');

mkaminski

2016-04-25 16:27

reporter   ~0003587

I am experiencing a similar problem for a unit test that uses Mockery with the "shouldIgnoreMissing()" feature set. It seems that there is an issue with running code coverage on some eval()'ed code. I'm working to reproduce the problem with a small example.

For the time being, I've ascertained that the segfault is occurring on line 812 in xdebug_code_coverage.c (https://github.com/xdebug/xdebug/blob/140bbcd5cb57065f5885afb93397f006ad7e183e/xdebug_code_coverage.c#L812), according to my last gdb run, the output of which I will attach here. Please let me know how I can be of further assistance.

Naktibalda

2016-05-26 20:18

reporter   ~0003609

Last edited: 2016-05-26 20:20

I reproduced this issue while investigating segmentation fault of PHP builtin http server.

index.php
<?php
function x() {}
xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
x();
?>

php -S 127.0.0.1:8001

Server crashes on the second request:
wget http://127.0.0.1:8001
wget http://127.0.0.1:8001

Output:
PHP 7.0.6-1+donate.sury.org~trusty+1 Development Server started at Thu May 26 21:19:33 2016
Listening on http://127.0.0.1:8001
Document root is /home/.../xdebug-test
Press Ctrl-C to quit.

Segmentation fault (core dumped)

derick

2016-05-26 20:24

administrator   ~0003610

Thanks, Naktibalda - I can reproduce your segfault without opcache enabled.

derick

2016-05-29 08:09

administrator   ~0003615

Naktibalda, I fixed your issue in GIT now. Can everybody else try with the latest from GIT master as well please?

Naktibalda

2016-06-04 22:30

reporter   ~0003624

Derick, thank you. I can confirm that it solved my issue.

Naktibalda

2016-06-04 22:35

reporter   ~0003625

It solved onedev_link's issue too.

derick

2016-06-06 21:25

administrator   ~0003627

OK. Closing it then, and marking it as fixed for 2.4.1.

Issue History

Date Modified Username Field Change
2016-01-11 15:32 rsmith@golumigent.com New Issue
2016-01-11 22:13 derick Note Added: 0003395
2016-01-11 22:13 derick Assigned To => derick
2016-01-11 22:13 derick Status new => feedback
2016-01-11 22:25 rsmith@golumigent.com Note Added: 0003398
2016-01-11 22:25 rsmith@golumigent.com Status feedback => assigned
2016-01-11 22:47 derick Note Added: 0003400
2016-01-12 09:08 derick Note Added: 0003410
2016-01-12 14:35 rsmith@golumigent.com Note Added: 0003415
2016-01-20 16:37 driusan Note Added: 0003429
2016-01-22 11:26 interfaSys Note Added: 0003432
2016-02-08 21:04 derick Note Added: 0003452
2016-02-08 21:04 derick Status assigned => feedback
2016-02-08 21:38 rsmith@golumigent.com Note Added: 0003462
2016-02-08 21:38 rsmith@golumigent.com Status feedback => assigned
2016-02-08 21:50 interfaSys Note Added: 0003463
2016-02-08 22:00 derick Note Added: 0003464
2016-02-08 22:00 derick Status assigned => feedback
2016-02-27 15:59 derick Note Added: 0003525
2016-02-29 13:20 rsmith@golumigent.com Note Added: 0003536
2016-02-29 13:20 rsmith@golumigent.com Status feedback => assigned
2016-02-29 17:35 interfaSys Note Added: 0003537
2016-02-29 17:35 interfaSys Note Edited: 0003537
2016-03-04 15:38 derick Note Added: 0003543
2016-03-05 19:40 interfaSys Note Added: 0003562
2016-03-07 13:52 rsmith@golumigent.com Note Added: 0003565
2016-03-24 10:45 onedev_link Note Added: 0003573
2016-04-22 11:00 onedev_link Note Added: 0003585
2016-04-25 16:27 mkaminski Note Added: 0003587
2016-04-25 16:28 mkaminski File Added: gdb_run.txt
2016-05-26 20:18 Naktibalda Note Added: 0003609
2016-05-26 20:20 Naktibalda Note Edited: 0003609
2016-05-26 20:24 derick Note Added: 0003610
2016-05-29 08:09 derick Note Added: 0003615
2016-06-04 22:30 Naktibalda Note Added: 0003624
2016-06-04 22:35 Naktibalda Note Added: 0003625
2016-06-06 21:25 derick Note Added: 0003627
2016-06-06 21:25 derick Status assigned => closed
2016-06-06 21:25 derick Resolution open => fixed
2016-06-06 21:25 derick Fixed in Version => 2.4.1
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized