MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001261XdebugUsage problems (Wrong Results)public2016-01-27 19:072016-02-09 21:04
Reporternacc 
Assigned Toderick 
PriorityhighSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS Version16.04
Product Version2.4.0rc4 
Target VersionFixed in Version2.4.0 
Summary0001261: segmentation fault in xdebug.so with PHP7.0 version of 'pkgtools'
DescriptionWhile helping port packages over to PHP7.0 in Ubuntu, I ran across a segmentation fault when running the `pkgtools` command, if the latest version(s) of php-xdebug were installed.

xdebug 2.4.0-rc4 & php 7.0.2

The script is bin/pkgtools from
http://anonscm.debian.org/cgit/pkg-php/pkg-php-tools.git/log/?h=master-7.0 [^]

The core dump occurs regardless of any parameters to pkgtools (i.e.,
just running `pkgtools` should be sufficient).
Steps To ReproduceI reproduce this by spinning up a VM (technically a chroot, but
equivalent for this purpose) with Ubuntu Xenial, and adding a PPA to it
(https://launchpad.net/~php-ubuntu/+archive/ubuntu/php7.0 [^]). Update and
`apt-get install pkg-php-tools php-xdebug` and run `pkgtools`.
Additional InformationDerick provided a temporary patch on the ML, but it fails a PHP7 test case.

diff --git a/xdebug_stack.c b/xdebug_stack.c
index 2df4c99..ce57521 100644
--- a/xdebug_stack.c
+++ b/xdebug_stack.c
@@ -1147,7 +1147,7 @@ static void xdebug_build_fname(xdebug_func *tmp, zend_execute_data *edata TSRMLS
                ) {
                        tmp->type = XFUNC_NORMAL;
                        tmp->function = xdstrdup("{internal eval}");
- } else if (edata && edata->prev_execute_data && edata->prev_execute_data->opline && edata->prev_execute_data->opline->opcode == ZEND_INCLUDE_OR_EVAL) {
+ } else if (edata && edata->prev_execute_data && edata->prev_execute_data->func->type == ZEND_USER_FUNCTION && edata->prev_execute_data->opline &&
+edata->prev_execute_data->opline->opcode == ZEND_INCLUDE_OR_EVAL) {
                        switch (edata->prev_execute_data->opline->extended_value) {
                                case ZEND_EVAL:
                                        tmp->type = XFUNC_EVAL;
TagsNo tags attached.
Operating SystemUbuntu 16.04
PHP Version7.0.0-7.0.4
Attached Files

- Relationships

-  Notes
(0003434)
nacc (reporter)
2016-01-27 23:29

Tested the patch and confirmed the patch resolves the segmentation fault.
(0003473)
derick (administrator)
2016-02-09 21:04

Fixed in GIT, for 2.4.0.

- Issue History
Date Modified Username Field Change
2016-01-27 19:07 nacc New Issue
2016-01-27 23:29 nacc Note Added: 0003434
2016-02-09 21:04 derick Note Added: 0003473
2016-02-09 21:04 derick Status new => closed
2016-02-09 21:04 derick Assigned To => derick
2016-02-09 21:04 derick Resolution open => fixed
2016-02-09 21:04 derick Fixed in Version => 2.4.0
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