View Issue Details

IDProjectCategoryView StatusLast Update
0001261XdebugUncategorizedpublic2016-02-09 21:04
Reporternacc Assigned Toderick  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version16.04
Product Version2.4.0rc4 
Fixed in Version2.4.0 
Summary0001261: segmentation fault in xdebug.so with PHP7.0 version of 'pkgtools'
Description

While 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 Reproduce

I 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 Information

Derick 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

Activities

nacc

2016-01-27 23:29

reporter   ~0003434

Tested the patch and confirmed the patch resolves the segmentation fault.

derick

2016-02-09 21:04

administrator   ~0003473

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 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