View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001263 | Xdebug | public | 2016-02-04 17:33 | 2016-06-06 21:26 | |
Reporter | iwex | Assigned To | derick | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Ubuntu | OS Version | 14.04 |
Product Version | 2.4.0rc4 | ||||
Fixed in Version | 2.4.1 | ||||
Summary | 0001263: Code coverage segmentation fault | ||||
Description | When we run ours coverage tests we get Segmentation fault error. Program received signal SIGSEGV, Segmentation fault. | ||||
Steps To Reproduce | This causes error: public function getRequest() This works fine: public function getRequest() | ||||
Tags | No tags attached. | ||||
Attached Files | xdebug_info.txt (7,550 bytes)
php -dzend_extension=xdebug.so -v PHP 7.0.3-4+deb.sury.org~wily+1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Xdebug v2.4.0RC4, Copyright (c) 2002-2016, by Derick Rethans ********** php -dzend_extension=xdebug.so --ri Xdebug xdebug xdebug support => enabled Version => 2.4.0RC4 IDE Key => tony Supported protocols => Revision DBGp - Common DeBuGger Protocol => $Revision: 1.145 $ Directive => Local Value => Master Value xdebug.auto_trace => Off => Off xdebug.trace_enable_trigger => Off => Off xdebug.trace_enable_trigger_value => no value => no value xdebug.trace_output_dir => /tmp => /tmp xdebug.trace_output_name => trace.%c => trace.%c xdebug.trace_format => 0 => 0 xdebug.trace_options => 0 => 0 xdebug.coverage_enable => On => On xdebug.collect_includes => On => On xdebug.collect_params => 0 => 0 xdebug.collect_return => Off => Off xdebug.collect_vars => Off => Off xdebug.collect_assignments => Off => Off xdebug.default_enable => On => On xdebug.extended_info => On => On xdebug.file_link_format => no value => no value xdebug.force_display_errors => Off => Off xdebug.force_error_reporting => 0 => 0 xdebug.halt_level => 0 => 0 xdebug.max_nesting_level => 256 => 256 xdebug.max_stack_frames => -1 => -1 xdebug.overload_var_dump => On => On xdebug.show_error_trace => Off => Off xdebug.show_exception_trace => Off => Off xdebug.show_local_vars => Off => Off xdebug.show_mem_delta => Off => Off xdebug.dump.COOKIE => no value => no value xdebug.dump.ENV => no value => no value xdebug.dump.FILES => no value => no value xdebug.dump.GET => no value => no value xdebug.dump.POST => no value => no value xdebug.dump.REQUEST => no value => no value xdebug.dump.SERVER => no value => no value xdebug.dump.SESSION => no value => no value xdebug.dump_globals => On => On xdebug.dump_once => On => On xdebug.dump_undefined => Off => Off xdebug.profiler_enable => On => On xdebug.profiler_output_dir => /home/tony/xdebug_snapshots => /home/tony/xdebug_snapshots xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p xdebug.profiler_enable_trigger => On => On xdebug.profiler_enable_trigger_value => no value => no value xdebug.profiler_append => Off => Off xdebug.profiler_aggregate => Off => Off xdebug.remote_enable => On => On xdebug.remote_handler => dbgp => dbgp xdebug.remote_host => localhost => localhost xdebug.remote_mode => req => req xdebug.remote_port => 9000 => 9000 xdebug.remote_autostart => Off => Off xdebug.remote_connect_back => Off => Off xdebug.remote_log => no value => no value xdebug.idekey => no value => no value xdebug.remote_cookie_expire_time => 3600 => 3600 xdebug.remote_addr_header => no value => no value xdebug.var_display_max_children => 128 => 128 xdebug.var_display_max_data => 512 => 512 xdebug.var_display_max_depth => 3 => 3 xdebug.cli_color => 0 => 0 xdebug.scream => Off => Off ********** gdb --args php -dzend_extension=xdebug.so bin/phpunit --configuration build/phpunit-with-coverage.xml (gdb) run Starting program: /usr/bin/php -dzend_extension=xdebug.so bin/phpunit --configuration build/phpunit-with-coverage.xml [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". PHPUnit 5.2.4 by Sebastian Bergmann and contributors. Runtime: PHP 7.0.3-4+deb.sury.org~wily+1 with Xdebug 2.4.0RC4 Configuration: /home/tony/PhpstormProjects/xdebug/build/phpunit-with-coverage.xml Program received signal SIGSEGV, Segmentation fault. 0x00007ffff2f6409e in xdebug_set_in_ex (set=set@entry=0x124e2f0, position=position@entry=4294967040, noisy=noisy@entry=1) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_set.c:72 72 /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_set.c: Datei oder Verzeichnis nicht gefunden. (gdb) bt full #0 0x00007ffff2f6409e in xdebug_set_in_ex (set=set@entry=0x124e2f0, position=position@entry=4294967040, noisy=noisy@entry=1) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_set.c:72 byte = 0x2138c940 <error: Cannot access memory at address 0x2138c940> bit = 0 #1 0x00007ffff2f56a9d in xdebug_analyse_branch (opa=opa@entry=0x12aff18, position=<optimized out>, set=set@entry=0x124e2f0, branch_info=branch_info@entry=0x0) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:705 jump_pos1 = 2147483646 jump_pos2 = 2147483646 #2 0x00007ffff2f56c19 in xdebug_analyse_branch (opa=opa@entry=0x12aff18, position=63, set=set@entry=0x124e2f0, branch_info=branch_info@entry=0x0) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:729 jump_pos1 = <optimized out> jump_pos2 = <optimized out> #3 0x00007ffff2f56c19 in xdebug_analyse_branch (opa=opa@entry=0x12aff18, position=24, set=set@entry=0x124e2f0, branch_info=branch_info@entry=0x0) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:729 jump_pos1 = <optimized out> jump_pos2 = <optimized out> #4 0x00007ffff2f56c19 in xdebug_analyse_branch (opa=opa@entry=0x12aff18, position=23, position@entry=0, set=set@entry=0x124e2f0, branch_info=branch_info@entry=0x0) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:729 jump_pos1 = <optimized out> jump_pos2 = <optimized out> #5 0x00007ffff2f57187 in xdebug_analyse_oparray (branch_info=<optimized out>, set=0x124e2f0, opa=0x12aff18) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:787 position = 0 #6 prefill_from_oparray (filename=0x7fffe5909b60 "/home/tony/PhpstormProjects/xdebug/vendor/phpunit/php-code-coverage/src/CodeCoverage.php", op_array=0x12aff18) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:872 i = <optimized out> set = 0x124e2f0 branch_info = <optimized out> #7 0x00007ffff2f57327 in prefill_from_function_table (opa=<optimized out>) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:914 opa = <optimized out> #8 prefill_from_class_table (class_entry=<optimized out>, num_args=<optimized out>, args=<optimized out>, hash_key=<optimized out>) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:942 _z = 0x1296220 _p = 0x1296220 _end = 0x1296300 val = <optimized out> ce = 0x12ae800 #9 0x000000000073eee9 in zend_hash_apply_with_arguments () No symbol table info available. #10 0x00007ffff2f585e3 in xdebug_prefill_code_coverage (op_array=<optimized out>) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:961 No locals. #11 0x00007ffff2f5860b in xdebug_code_coverage_start_of_function (op_array=op_array@entry=0x11a8978) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug_code_coverage.c:968 path = 0x1283120 #12 0x00007ffff2f52faa in xdebug_execute_ex (execute_data=0x7ffff7f10b40) at /build/xdebug-Gsv8dd/xdebug-2.4.0~rc4/xdebug-2.4.0RC4/xdebug.c:1849 op_array = 0x11a8978 edata = <optimized out> dummy = <optimized out> fse = 0x129bfb0 xfse = <optimized out> magic_cookie = <optimized out> do_return = 0 function_nr = 5946 le = <optimized out> #13 0x000000000071e64c in zend_call_function () No symbol table info available. #14 0x000000000074a292 in zend_call_method () No symbol table info available. | ||||
Operating System | |||||
PHP Version | 7.0.0-7.0.4 | ||||
|
Can you provide a full but small script that I can run that demonstrates the problem? Starting it with: <?php … your code … should do the trick |
|
We have the same problem here. Ubuntu 15.10 with PHP from Sury PPA PHP 5.6 with coverage works: PHP 5.6.18-2+deb.sury.org~wily+1 (cli) PHP 7.0 with coverage does segfault: PHP 7.0.3-2+deb.sury.org~wily+1 (cli) ( NTS ) |
|
TonyBologni, iwex. I really need a reproducible script that I can run locally (without any dependencies) to fix this. Without this, I can't debug it. |
|
Hi Derick! The problem is that I have no idea what causes the segfault, so how to reproduce without dependencies. I have tried some simple script (as you suggested above), but this works fine. |
|
TonyBolgoni - can you packaged it up in something that I can run with a "one shot command"? (Ie, without having to setup or configure anything)? |
|
Oh my. Seems the original problem in this bug is not exactly the problem we are facing, we can't make anything work by changing the code that is tested. @Derick, should I open another bug? Our problem seems very much related with PHPUnit and output while xdebug_coverate is started, but not stopped. |
|
Derick, would it help if I build phar archive including everything that's causing our segfault problem? |
|
TonyBolgoni - no, please no phar. Just something I can extract and run (like a .tar.gz) |
|
Hi Derick, the archive I have uploaded works for me, hopefully also for you. Run where you extract it: bin/phpunit --configuration build/phpunit-with-coverage.xml This assumes xdebug is enabled, I have it disabled by default, so I run: I hope this is sufficient for identifying the problem. |
|
Tony, sorry, I can't reproduce this with PHP 7.0.4 and Xdebug 2.4.0RC3, RC4 and RC5-dev. I might need more information: The output of: php -dzend_extension=xdebug.so -v And then the output of: Export variables: Starts gdb (you might have to install it first): On the prompt type: And when it crashes, type: Please attach all three outputs, put together in one file. |
|
I've uploded the file, in case you were not notified. |
|
JFTR I can't get this to segfault with PHP 7.0.3-5 on Debian unstable and xdebug 2.4.0~rc4. Nor I can reproduce this on neither Ubuntu Trusty nor Ubuntu Wily with PHP 7.0.3-4 and 7.0.3-5. I tested this on amd64 arch. Just for the case I tried Ubuntu Wily i386 and I can't reproduce this there. I don't have any armhf around to test. valgrind also doesn't detect anything suspicious (on i386): |
|
Hi Ondrej, that's weird. I have it on two different machines, so it does not seem to be a weird edge case. Any chance it has to do with remainders of PHP5 (also from your PPA) that were not removed by apt? If so, what would I look for? |
|
I don't think that leftovers from php5 should matter at all. You could issue Any chance you have any other PECL extensions installed & enabled? |
|
Just checked whether I can reproduce this on Debian jessie (my build machine): |
|
Or any cruft installed in /usr/local/? (This is also common source of random unreproducible segfaults.) What does |
|
ldd /usr/bin/php7.0
ldd /usr/lib/php/20151012/xdebug.so |
|
Regarding pecl / pear. |
|
In your output I see a big number that's -2 without the sign. Which should only happen if there is something wrong with the data type. But I ought to get the same thing and I'm not. |
|
I found something. I have installed a brand new Ubuntu 14.04 (server) with only PHP 7.0 from Ondrey PPA and tested on that. The two machines that also segfault are Ubuntu 15.10 (desktop) and there it's the same. With disabled opcache it works. I have attach a valgrind -v output. I have also tested on another brand new 14.04 server, same result, works without opcache, coredumps with opcache. |
|
Hi Derick, Ondrej! Any updates? |
|
Tony, I can reproduce this now, with opcache loaded and enabled on the cli. |
|
Valgrind also shows issues now: derick@whisky:/tmp/test $ valgrind php -dopcache.enable_cli=1 -dzend_extension=opcache.so bin/phpunit --configuration build/phpunit-with-coverage.xml Runtime: PHP 7.0.3-dev with Xdebug 2.4.0RC5-dev ==28797== Invalid read of size 1 ... |
|
Derick, is that something you can fix, or is it upstream? In opcache? |
|
No, I just need some time for this. |
|
My test cases now pass. I'm marking this as fixed for 2.4.1 which I'll be releasing shortly. |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-02-04 17:33 | iwex | New Issue | |
2016-02-05 10:31 | derick | Note Added: 0003437 | |
2016-02-05 10:31 | derick | Assigned To | => derick |
2016-02-05 10:31 | derick | Status | new => feedback |
2016-02-08 13:27 | TonyBologni | Note Added: 0003441 | |
2016-02-08 16:48 | derick | Note Added: 0003442 | |
2016-02-09 16:02 | TonyBologni | Note Added: 0003469 | |
2016-02-11 18:48 | derick | Note Added: 0003482 | |
2016-02-12 09:34 | TonyBologni | Note Added: 0003494 | |
2016-02-16 11:29 | TonyBologni | Note Added: 0003497 | |
2016-02-16 12:06 | derick | Note Added: 0003498 | |
2016-02-17 08:54 | TonyBologni | File Added: xdebug_test.tar.gz | |
2016-02-17 08:58 | TonyBologni | Note Added: 0003499 | |
2016-02-17 11:27 | derick | Note Added: 0003500 | |
2016-02-17 11:47 | TonyBologni | File Added: xdebug_info.txt | |
2016-02-17 16:36 | TonyBologni | Note Added: 0003501 | |
2016-02-18 14:47 | ondrej | Note Added: 0003502 | |
2016-02-18 14:54 | TonyBologni | Note Added: 0003503 | |
2016-02-18 15:23 | ondrej | Note Added: 0003504 | |
2016-02-18 15:36 | ondrej | Note Added: 0003505 | |
2016-02-18 15:47 | ondrej | Note Added: 0003506 | |
2016-02-18 15:53 | TonyBologni | Note Added: 0003507 | |
2016-02-18 15:54 | TonyBologni | Note Added: 0003508 | |
2016-02-18 15:59 | derick | Note Added: 0003509 | |
2016-02-18 21:37 | TonyBologni | Note Added: 0003510 | |
2016-02-18 21:38 | TonyBologni | File Added: valgrind.out | |
2016-02-18 21:51 | TonyBologni | Note Edited: 0003510 | |
2016-02-22 10:55 | TonyBologni | Note Added: 0003512 | |
2016-02-22 11:38 | derick | Note Added: 0003513 | |
2016-02-22 11:39 | derick | Note Added: 0003514 | |
2016-02-25 11:16 | TonyBologni | Note Added: 0003520 | |
2016-02-27 16:03 | derick | Note Added: 0003531 | |
2016-06-06 21:26 | derick | Note Added: 0003628 | |
2016-06-06 21:26 | derick | Status | feedback => closed |
2016-06-06 21:26 | derick | Resolution | open => fixed |
2016-06-06 21:26 | derick | Fixed in Version | => 2.4.1 |
2016-07-31 12:35 | derick | Category | Debug client (console) => debugclient (debugging tool) |
2016-07-31 12:35 | derick | Category | debugclient (debugging tool) => (No Category) |