View Issue Details

IDProjectCategoryView StatusLast Update
0001210XdebugUncategorizedpublic2015-12-07 11:32
Reporterkyrad Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Platformx64OSUbuntuOS Version14.04 LTS
Product Version2.4.0beta1 
Fixed in Version2.4.0rc2 
Summary0001210: Code Coverage Causes Segmentation Fault
Description

kyra@home:/tmp/xdebug$ /bin/php -dzend_extension=xdebug.so -ddisplay_errors=on -ddisplay_startup_errors=on -dxdebug.coverage_enable=1 ./vendor/phpunit/phpunit/phpunit --coverage-clover ./.coverage --configuration ./phpunit.xml
PHPUnit 5.0.9 by Sebastian Bergmann and contributors.

Runtime: PHP 7.0.0RC7 with Xdebug 2.4.0rc1-dev
Configuration: /tmp/xdebug/phpunit.xml

F 1 / 1 (100%)

Time: 90 ms, Memory: 2.00Mb

There was 1 failure:

1) Warning
No tests found in class "Acme\Rockets\Tests\RocketsTest".

FAILURES!
Tests: 1, Assertions: 0, Failures: 1.

Generating code coverage report in Clover XML format ...Segmentation fault

Steps To Reproduce

Please see attached minimal app archive to reproduce.

It doesn't matter if there are tests found or not, it still segfaults. I reduced the app to the bare minimum to reproduce the segfault.

Sorry if I have not provided enough info. This is my first time doing any of this =o)

Additional Information

Backtrace:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/bin/php -dzend_extension=xdebug.so -ddisplay_errors=on -ddisplay_startup_error'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fca8e3b9bf9 in xdebug_set_in_ex () from /usr/lib/php/extensions/xdebug.so
(gdb) bt
#0 0x00007fca8e3b9bf9 in xdebug_set_in_ex () from /usr/lib/php/extensions/xdebug.so
#1 0x00007fca8e3a59b6 in ?? () from /usr/lib/php/extensions/xdebug.so
0000002 0x00007fca8e3a5af1 in ?? () from /usr/lib/php/extensions/xdebug.so
0000003 0x00007fca8e3a5a7a in ?? () from /usr/lib/php/extensions/xdebug.so
0000004 0x00007fca8e3a5af1 in ?? () from /usr/lib/php/extensions/xdebug.so
0000005 0x00007fca8e3a5af1 in ?? () from /usr/lib/php/extensions/xdebug.so
0000006 0x00007fca8e3a5a7a in ?? () from /usr/lib/php/extensions/xdebug.so
0000007 0x00007fca8e3a5a7a in ?? () from /usr/lib/php/extensions/xdebug.so
0000008 0x00007fca8e3a5cce in ?? () from /usr/lib/php/extensions/xdebug.so
0000009 0x00007fca8e3a6014 in ?? () from /usr/lib/php/extensions/xdebug.so
0000010 0x00007fca8e3a61d6 in ?? () from /usr/lib/php/extensions/xdebug.so
0000011 0x00007fca8e3a62ae in ?? () from /usr/lib/php/extensions/xdebug.so
0000012 0x00000000009c4300 in zend_hash_apply_with_arguments (ht=0x226a810, apply_func=0x7fca8e3a61dd, num_args=1)
at ./php-src/Zend/zend_hash.c:1523
0000013 0x00007fca8e3a6397 in xdebug_prefill_code_coverage ()
from /usr/lib/php/extensions/xdebug.so
0000014 0x00007fca8e3a63bf in xdebug_code_coverage_start_of_function ()
from /usr/lib/php/extensions/xdebug.so
0000015 0x00007fca8e3a0cc2 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000016 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
0000017 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000018 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f214970) at ./php-src/Zend/zend_vm_execute.h:414
0000019 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000020 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
0000021 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000022 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f214880) at ./php-src/Zend/zend_vm_execute.h:414
0000023 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000024 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
0000025 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000026 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f214800) at ./php-src/Zend/zend_vm_execute.h:414
0000027 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000028 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
0000029 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000030 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f214740) at ./php-src/Zend/zend_vm_execute.h:414
0000031 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000032 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
0000033 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000034 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f2146a0) at ./php-src/Zend/zend_vm_execute.h:414
#35 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000036 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
0000037 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000038 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f214410) at ./php-src/Zend/zend_vm_execute.h:414
0000039 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000040 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
---Type <return> to continue, or q <return> to quit---
0000041 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000042 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f214290) at ./php-src/Zend/zend_vm_execute.h:414
0000043 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000044 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
0000045 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000046 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f214160) at ./php-src/Zend/zend_vm_execute.h:414
0000047 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000048 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
#49 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000050 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f2140c0) at ./php-src/Zend/zend_vm_execute.h:414
#51 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000052 0x0000000000a0bac3 in ZEND_DO_FCALL_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:800
0000053 0x0000000000a0e35e in ZEND_USER_OPCODE_SPEC_HANDLER () at ./php-src/Zend/zend_vm_execute.h:1589
0000054 0x0000000000a0ab12 in execute_ex (ex=0x7fca8f214030) at ./php-src/Zend/zend_vm_execute.h:414
0000055 0x00007fca8e3a0d98 in xdebug_execute_ex () from /usr/lib/php/extensions/xdebug.so
0000056 0x0000000000a0ac24 in zend_execute (op_array=0x7fca8f287000, return_value=0x0)
at ./php-src/Zend/zend_vm_execute.h:458
0000057 0x00000000009aef0c in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at ./php-src/Zend/zend.c:1428
0000058 0x000000000091c69f in php_execute_script (primary_file=0x7fffe73fc850) at ./php-src/main/main.c:2471
0000059 0x0000000000a6edb2 in do_cli (argc=12, argv=0x226a180) at ./php-src/sapi/cli/php_cli.c:974
0000060 0x0000000000a6ff80 in main (argc=12, argv=0x226a180) at ./php-src/sapi/cli/php_cli.c:1345

TagsSIGSEGV
Attached Files
segfault_app.tar.gz (1,159,255 bytes)
Operating SystemLinux
PHP Version7.0.0rc7

Activities

kyrad

2015-11-24 09:21

reporter   ~0003259

Have you been able to reproduce this? Do I need to provide more info?

derick

2015-11-24 13:01

administrator   ~0003261

I can reproduce this with Xdebug 2.4.0beta1, but no longer with 2.4.0rc1 that I released a few days ago. Could you please try that?

kyrad

2015-11-24 13:33

reporter   ~0003262

kyra@home:/tmp/xdebug/$ /bin/php -dzend_extension=xdebug.so -ddisplay_errors=on -ddisplay_startup_errors=on -dxdebug.coverage_enable=1 -c /etc/php/php.ini ./vendor/phpunit/phpunit/phpunit --coverage-clover ./.coverage --configuration ./phpunit.xml
PHPUnit 5.0.9 by Sebastian Bergmann and contributors.

Runtime: PHP 7.0.0RC7 with Xdebug 2.4.0rc2-dev
Configuration: /tmp/xdebug/phpunit.xml

F 1 / 1 (100%)

Time: 126 ms, Memory: 2.00Mb

There was 1 failure:

1) Warning
No tests found in class "Acme\Rockets\Tests\RocketsTest".

FAILURES!
Tests: 1, Assertions: 0, Failures: 1.

Generating code coverage report in Clover XML format ...Segmentation fault


This morning I compiled latest Xdebug master, the segfault is still occurring.

derick

2015-11-24 14:25

administrator   ~0003263

How odd. I can only reproduce this with the 32bit compile of PHP - even though you say you're using the 64bit variant.

kyrad

2015-11-24 15:47

reporter   ~0003264

Last edited: 2015-11-24 15:50

I didn't do anything special when compiling it on my x64 system. Do I need to specify the architecture type when compiling or does it just default to the native system (x64)?

Output of uname -a
Linux home 3.13.0-68-generic 0000111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Xdebug compile options:
./configure --enable-xdebug --with-php-config=/bin/php-config

derick

2015-11-29 18:49

administrator   ~0003270

I fixed this in Git master. Please reopen if you still can reproduce this with the latest from GitHub.

Issue History

Date Modified Username Field Change
2015-11-20 23:51 kyrad New Issue
2015-11-20 23:51 kyrad File Added: segfault_app.tar.gz
2015-11-20 23:57 kyrad Tag Attached: SIGSEGV
2015-11-24 09:21 kyrad Note Added: 0003259
2015-11-24 13:01 derick Note Added: 0003261
2015-11-24 13:01 derick Assigned To => derick
2015-11-24 13:01 derick Status new => feedback
2015-11-24 13:33 kyrad Note Added: 0003262
2015-11-24 13:33 kyrad Status feedback => assigned
2015-11-24 14:25 derick Note Added: 0003263
2015-11-24 15:47 kyrad Note Added: 0003264
2015-11-24 15:50 kyrad Note Edited: 0003264
2015-11-29 18:49 derick Note Added: 0003270
2015-11-29 18:49 derick Status assigned => closed
2015-11-29 18:49 derick Resolution open => fixed
2015-11-29 18:49 derick Fixed in Version => 2.4.0
2015-12-07 11:32 derick Fixed in Version 2.4.0 => 2.4.0rc2
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