View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001094 | Xdebug | Uncategorized | public | 2014-12-02 14:53 | 2015-02-22 14:30 |
Reporter | michaelmoussa | Assigned To | derick | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Ubuntu | OS Version | 14.04.1 LTS |
Fixed in Version | 2.3.0 | ||||
Summary | 0001094: Segmentation fault when attempting to use branch/path coverage from dev-master | ||||
Description | I've been playing with the new branch/path coverage available in the latest dev-master and looking into how to potentially use it to generate path coverage reports. I didn't have any problems when running the xdebug_ functions directly, but once I started using PHP_CodeCoverage, running the script would cause a segfault. I wanted to make sure the problem wasn't anything specific to PHP_CodeCoverage, and it turns out that running xdebug_start_code_coverage(...) from within any* function using the XDEBUG_CC_UNUSED setting causes my PHP to segfault. Works fine in the "root" / "main" part of the script right after the opening <?php tag. | ||||
Steps To Reproduce | Compile the latest xdebug dev-master (7c683817d377c5d5f7e518a8f64f8b0898b2e3d6 at the time of this reporting) and run the following PHP script: <?php echo "Trying with direct calls to xdebug_*..."; xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK); echo " done!\n\n"; echo "Trying from within a function..."; thisWillSegfault(); echo "...done!\n"; function foobarbaz($number)
} function thisWillSegfault() This is my output, every time: vagrant@packer-vmware-iso:/vagrant$ php segfault.php Trying from within a function...Segmentation fault | ||||
Additional Information | I ran a git bisect and kept recompiling & re-testing. The first bad commit according to git is commit 960223d3648d40bcbe5a2189f99d4663e98aaff6. Compiling anything before that no longer causes a segfault (but of course the branch/path coverage stuff doesn't work anymore because it didn't exist yet). | ||||
Tags | No tags attached. | ||||
Operating System | |||||
PHP Version | 5.5.15-5.5.19 | ||||
|
Thanks for testing this, I'll go and have a look tonight. |
|
Thanks. If it makes it easier for you to test, I'm using the puphpet/ubuntu1404-x64 box as a basis: VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
|
Fixed in 2.3.0dev, through https://github.com/xdebug/xdebug/pull/135 |
|
Thanks for producing a patch so quickly, but unfortunately I seem to still be having the same problem. vagrant@packer-vmware-iso:~/src/xdebug$ git checkout f982e62f0cd2a22b01e3fd53cf1e7c116c79772d vagrant@packer-vmware-iso:~/src/xdebug$ make clean && phpize && ./configure --enable-xdebug && make && sudo cp modules/xdebug.so /usr/lib/php5/20121212/ && php -i | grep 'with Xdebug' && php /vagrant/segfault.php -- snip configure/compile spam --
Trying with direct calls to xdebug_*... done! Trying from within a function...Segmentation fault Oddly enough, the test you added passes: vagrant@packer-vmware-iso:~/src/xdebug$ make test | grep bug01094 Out of curiousity, I recompiled it on OSX as well and got the same result, so it isn't specific to this Vagrant VM. Is there some kind of debugging output I can produce to help you track this down? |
|
I figured out the problem! :) I copied & pasted the test you added to the repo into a PHP file and was able to run it successfully, then compared it to the original sample I included in this ticket. The test was missing this portion: echo "Trying with direct calls to xdebug_*..."; xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK); echo " done!\n\n"; And that's what made all the difference. The patch fixed the "fails if you call it within a function" issue, but apparently it will still segfault if you call the xdebug_start/stop functions, then call them AGAIN within a function. Probably an edge-case, so I'll leave it to you to decide if it's worth investigating further at this point. The original reason I opened this ticket has indeed been resolved, though, so feel free to close it out. |
|
Just a quick note - spend some time on this and I see the problem(s). I'll get to it, but it's going to take some time. |
|
OKAY. I've pushed another fix. Care to try it again? |
|
It works now. Thanks a lot for taking care of this. |
|
Awesome, thanks for checking! |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-12-02 14:53 | michaelmoussa | New Issue | |
2014-12-02 14:59 | derick | Note Added: 0002923 | |
2014-12-02 14:59 | derick | Assigned To | => derick |
2014-12-02 14:59 | derick | Status | new => acknowledged |
2014-12-02 15:04 | michaelmoussa | Note Added: 0002924 | |
2014-12-02 21:30 | derick | Note Added: 0002926 | |
2014-12-02 21:30 | derick | Status | acknowledged => closed |
2014-12-02 21:30 | derick | Resolution | open => fixed |
2014-12-02 21:30 | derick | Fixed in Version | => 2.3dev |
2014-12-03 01:29 | michaelmoussa | Note Added: 0002927 | |
2014-12-03 01:29 | michaelmoussa | Status | closed => feedback |
2014-12-03 01:29 | michaelmoussa | Resolution | fixed => reopened |
2014-12-04 03:57 | michaelmoussa | Note Added: 0002928 | |
2014-12-04 03:57 | michaelmoussa | Status | feedback => assigned |
2014-12-08 09:47 | derick | Note Added: 0002929 | |
2014-12-13 20:32 | derick | Note Added: 0002931 | |
2014-12-13 20:32 | derick | Status | assigned => feedback |
2014-12-16 03:31 | michaelmoussa | Note Added: 0002939 | |
2014-12-16 03:31 | michaelmoussa | Status | feedback => assigned |
2014-12-16 10:13 | derick | Note Added: 0002940 | |
2014-12-16 10:13 | derick | Status | assigned => closed |
2014-12-16 10:13 | derick | Resolution | reopened => fixed |
2015-02-22 14:30 | derick | Fixed in Version | 2.3dev => 2.3.0 |
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 |