MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001121XdebugUsage problems (Wrong Results)public2015-03-02 22:012015-03-21 23:06
Reporterjim.delois 
Assigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version2.3.2 
Summary0001121: Segfault: 11 Continues
DescriptionI am attempting to update the "phpunit/php-code-coverage" package to employ the new path coverage feature. While trivial examples work, attempting to set the flag within the PHPUnit library causes the dreaded Segfault, despite a recent patch to fix this from segfaulting when being called from within a function. It's not yet immediately clear to me what the issue is, so I'm filing a bug here and hoping that this can be addressed shortly so I can work to improve the PHPUnit project. Thanks!
Steps To ReproducePlease see attached image.

1. In any version of phpunit/php-code-coverage, modify ./src/CodeCoverage/Driver/Xdebug.php , replacing

xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);

with

xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK );

(~line 47)

2. From the project root, run

./vendor/bin/phpunit


EXPECTED OUTPUT:

PHPUnit 4.5.0 by Sebastian Bergmann and contributors.

Configuration read from /Users/delois/Development/source/Other/dev/sebastianbergmann/php-code-coverage/phpunit.xml.dist

...................................................

Time: 6.21 seconds, Memory: 13.50Mb

OK (51 tests, 93 assertions)

Generating code coverage report in Clover XML format ... done

Generating code coverage report in HTML format ... done



ACTUAL OUTPUT:

PHPUnit 4.5.0 by Sebastian Bergmann and contributors.

Configuration read from /Users/delois/Development/source/Other/dev/sebastianbergmann/php-code-coverage/phpunit.xml.dist

Segmentation fault: 11
Additional InformationAs per the discussion here http://bugs.xdebug.org/view.php?id=1119, [^] I have checkout out and compiled the latest from branch xdebug_2_3 . I will attach a gdb backtrace immediately.
TagsNo tags attached.
Operating System
PHP Version5.6.0-5.6.4
Attached Filespng file icon Screen Shot 2015-03-02 at 4.52.55 PM.png [^] (282,713 bytes) 2015-03-02 22:01

- Relationships

-  Notes
(0003026)
jim.delois (reporter)
2015-03-02 22:04

GDB Backtrace:

php-code-coverage root# gdb --args php ./vendor/bin/phpunit --debug
GNU gdb (GDB) 7.8.2
Copyright (C) 2014 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-apple-darwin14.1.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>. [^]
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>. [^]
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from php...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/local/bin/php ./vendor/bin/phpunit --debug
warning: Could not open OSO archive file "/BinaryCache/corecrypto/corecrypto-233.1.2~26/Symbols/BuiltProducts/libcorecrypto_static.a"
warning: `/BinaryCache/coreTLS/coreTLS-35.1.2~2/Objects/coretls.build/coretls.build/Objects-normal/x86_64/system_coretls_vers.o': can't open to read symbols: No such file or directory.
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.1.2~2/Symbols/BuiltProducts/libcoretls_ciphersuites.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.1.2~2/Symbols/BuiltProducts/libcoretls_handshake.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.1.2~2/Symbols/BuiltProducts/libcoretls_record.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.1.2~2/Symbols/BuiltProducts/libcoretls_stream_parser.a"
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bdz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bdz_ph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bmz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bmz8.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/brz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/buffer_entry.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/buffer_manager.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chd.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chd_ph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chm.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/cmph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/cmph_structs.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/compressed_rank.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/compressed_seq.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/fch.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/fch_buckets.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/graph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/hash.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/jenkins_hash.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/linear_string_map.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/miller_rabin.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/select.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/vqueue.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/vstack.o': can't open to read symbols: No such file or directory.
PHPUnit 4.5.0 by Sebastian Bergmann and contributors.

Configuration read from /Users/delois/Development/source/Other/dev/sebastianbergmann/php-code-coverage/phpunit.xml.dist


Starting test 'PHP_CodeCoverage_FilterTest::testAddingAFileToTheBlacklistWorks'.

Program received signal SIGSEGV, Segmentation fault.
0x00000001029c8494 in xdebug_branch_info_mark_reached () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
(gdb) bt full
#0 0x00000001029c8494 in xdebug_branch_info_mark_reached () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
#1 0x00000001029c88f6 in xdebug_print_opcode_info () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000002 0x00000001029c8a44 in xdebug_common_override_handler () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000003 0x000000010041db96 in ZEND_USER_OPCODE_SPEC_HANDLER ()
No symbol table info available.
0000004 0x00000001003e27fc in execute_ex ()
No symbol table info available.
0000005 0x00000001003acfe1 in dtrace_execute_ex ()
No symbol table info available.
0000006 0x00000001029c5e09 in xdebug_execute_ex () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000007 0x0000000100424405 in zend_do_fcall_common_helper_SPEC ()
No symbol table info available.
0000008 0x00000001003e27fc in execute_ex ()
No symbol table info available.
0000009 0x00000001003acfe1 in dtrace_execute_ex ()
No symbol table info available.
0000010 0x00000001029c5e09 in xdebug_execute_ex () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000011 0x0000000100424405 in zend_do_fcall_common_helper_SPEC ()
No symbol table info available.
0000012 0x00000001003e27fc in execute_ex ()
No symbol table info available.
0000013 0x00000001003acfe1 in dtrace_execute_ex ()
No symbol table info available.
0000014 0x00000001029c5e09 in xdebug_execute_ex () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000015 0x0000000100424405 in zend_do_fcall_common_helper_SPEC ()
No symbol table info available.
0000016 0x00000001003e27fc in execute_ex ()
No symbol table info available.
0000017 0x00000001003acfe1 in dtrace_execute_ex ()
No symbol table info available.
0000018 0x00000001029c5e09 in xdebug_execute_ex () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000019 0x0000000100424405 in zend_do_fcall_common_helper_SPEC ()
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
0000020 0x00000001003e27fc in execute_ex ()
No symbol table info available.
0000021 0x00000001003acfe1 in dtrace_execute_ex ()
No symbol table info available.
0000022 0x00000001029c5e09 in xdebug_execute_ex () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000023 0x0000000100424405 in zend_do_fcall_common_helper_SPEC ()
No symbol table info available.
0000024 0x00000001003e27fc in execute_ex ()
No symbol table info available.
0000025 0x00000001003acfe1 in dtrace_execute_ex ()
No symbol table info available.
0000026 0x00000001029c5e09 in xdebug_execute_ex () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000027 0x0000000100424405 in zend_do_fcall_common_helper_SPEC ()
No symbol table info available.
0000028 0x00000001003e27fc in execute_ex ()
No symbol table info available.
0000029 0x00000001003acfe1 in dtrace_execute_ex ()
No symbol table info available.
0000030 0x00000001029c5e09 in xdebug_execute_ex () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
0000031 0x0000000100424405 in zend_do_fcall_common_helper_SPEC ()
No symbol table info available.
0000032 0x00000001003e27fc in execute_ex ()
No symbol table info available.
0000033 0x00000001003acfe1 in dtrace_execute_ex ()
No symbol table info available.
0000034 0x00000001029c5e09 in xdebug_execute_ex () from /Users/delois/Development/source/Other/dev/xdebug/xdebug/modules/xdebug.so
No symbol table info available.
#35 0x00000001003bb6f0 in zend_execute_scripts ()
No symbol table info available.
0000036 0x00000001003645d0 in php_execute_script ()
No symbol table info available.
0000037 0x0000000100443915 in do_cli ()
No symbol table info available.
0000038 0x0000000100442572 in main ()
No symbol table info available.
(0003027)
derick (administrator)
2015-03-03 08:16

I'm having trouble reproducing it - can you tell me the exact git clones and composer installs that I need to run?
(0003030)
jim.delois (reporter)
2015-03-03 16:33
edited on: 2015-03-03 18:46

Hi, Derick - thanks for responding!

As far as the XDebug versions/branch, I have been able to reproduce this issue with 2.3.0, 2.3.1, and the xdebug_2_3 branch which the screenshot in the original report showed as "v2.3.2-dev".

To replicate using the code, perform the following:

1. Clone my fork:
$> git clone git@github.com:jimdelois/php-code-coverage.git

2. Switch to the branch that just has the one-line change which adds the XDEBUG_CC_BRANCH_CHECK to xdebug_start_code_coverage within src/CodeCoverage/Driver/Xdebug.php
$> cd php-code-coverage/
$> git fetch
$> git checkout feature-path-coverage

3. Initialize the project
$> composer install

4. Run the test suite for this project, which reproduces the error.
$> ./vendor/bin/phpunit

I have reproduced this error on PHP 5.6.5 (Mac/homebrew), and Ubuntu PHP 5.6.4 (Docker)

(0003033)
derick (administrator)
2015-03-04 01:28

I can reproduce this now too. A fix will have to wait a little while as I'm out of country for a few days.
(0003034)
jim.delois (reporter)
2015-03-04 05:01

Great! I'm thrilled to hear that you can reproduce the issue.

The community is very excited about this feature, as I'm sure you're aware. Please don't hesitate to let me know how I can assist.

Thanks again!
(0003050)
derick (administrator)
2015-03-21 23:06

Fixed - I think.

- Issue History
Date Modified Username Field Change
2015-03-02 22:01 jim.delois New Issue
2015-03-02 22:01 jim.delois File Added: Screen Shot 2015-03-02 at 4.52.55 PM.png
2015-03-02 22:04 jim.delois Note Added: 0003026
2015-03-03 08:16 derick Note Added: 0003027
2015-03-03 08:16 derick Assigned To => derick
2015-03-03 08:16 derick Status new => feedback
2015-03-03 16:33 jim.delois Note Added: 0003030
2015-03-03 16:33 jim.delois Status feedback => assigned
2015-03-03 18:46 jim.delois Note Edited: 0003030 View Revisions
2015-03-04 01:28 derick Note Added: 0003033
2015-03-04 05:01 jim.delois Note Added: 0003034
2015-03-21 23:06 derick Note Added: 0003050
2015-03-21 23:06 derick Status assigned => closed
2015-03-21 23:06 derick Resolution open => fixed
2015-03-21 23:06 derick Fixed in Version => 2.3.2
2016-07-31 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker