View Issue Details

IDProjectCategoryView StatusLast Update
0001760XdebugCode Coveragepublic2020-03-13 01:06
Reporterjwos Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version2.5.5 
Summary0001760: xdebug appears the line that's not exist at all
Description

i'm using xdebug to collect coverage data from a web framework CodeIgniter ,but somethind weird happen, the coverage data contains lines that the file could never have, like the autoload.php

<pre>
<?php

// autoload.php @generated by Composer

require_once DIR . '/composer/autoload_real.php';

return ComposerAutoloaderInitb2b31c9dfea89a8b6a59f8b59f651b1a::getLoader();
</pre>

and the coverage data is this:

"share/php/framework/system/vendor/autoload.php":{"5":1,"7":1,"8":-2,"23":1}

the file autload.php only has 8 line ,so line 23 comes out of where?

and the 23 can always appear with specific request

i'mt sorry that the php framework code is too large to bring out and i cant give a small sample file to test

Tagscoverage
Attached Files
autoload.php (185 bytes)   
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitb2b31c9dfea89a8b6a59f8b59f651b1a::getLoader();
autoload.php (185 bytes)   
Operating System
PHP Version5.6.20-5.6.24

Activities

derick

2020-03-12 09:53

administrator   ~0005282

Xdebug 2.5 is no longer supported (https://xdebug.org/docs/compat) and neither is PHP 5.6 (https://www.php.net/supported-versions.php). If you can reproduce this problem with supported versions, then please update this report with a full self-contained example, with all steps required for me to reproduce this problem. Without this, I can not investigate, and hence, attempt to fix this problem.

cheers,
Derick

jwos

2020-03-12 12:36

reporter   ~0005283

i provide a sample project here, you can unzip it
and run by this:

cd vendor
php autoload.php

the running result in my environment is :
'/root/phpok/vendor/autoload.php' =>
array(4) {
[5] =>
int(1)
[7] =>
int(1)
[8] =>
int(1)
[23] =>
int(1)
}
'/root/phpok/vendor/composer/ClassLoader.php' =>
array(5) {
[44] =>
int(1)
[302] =>
int(1)
[303] =>
int(1)
[442] =>
int(1)
[446] =>
int(1)
}

hope that i can help you to reproduce this problem

phpbug.zip (7,126 bytes)

derick

2020-03-12 14:12

administrator   ~0005284

Last edited: 2020-03-12 14:13

I can only reproduce this with PHP 5.5 and 5.6, and not with PHP 7.0 or later:

<pre>
derick@gargleblaster:/tmp/phpbug/vendor$ pe 5.5.38; php -dzend_extension_debug=xdebug.so autoload.php
/tmp/phpbug/vendor/autoload.php:9:
array(4) {
[5] =>
int(1)
[7] =>
int(1)
[8] =>
int(1)
[23] =>
int(1)
}
</pre><pre>
derick@gargleblaster:/tmp/phpbug/vendor$ pe 5.6.40; php -dzend_extension=xdebug.so autoload.php
/tmp/phpbug/vendor/autoload.php:9:
array(4) {
[5] =>
int(1)
[7] =>
int(1)
[8] =>
int(1)
[23] =>
int(1)
}
</pre><pre>
derick@gargleblaster:/tmp/phpbug/vendor$ pe 7.0dev; php -dzend_extension=xdebug.so autoload.php
/tmp/phpbug/vendor/autoload.php:9:
array(3) {
[5] =>
int(1)
[7] =>
int(1)
[8] =>
int(1)
}
</pre><pre>
derick@gargleblaster:/tmp/phpbug/vendor$ pe 7.1dev; php -dzend_extension=xdebug.so autoload.php
/tmp/phpbug/vendor/autoload.php:9:
array(3) {
[5] =>
int(1)
[7] =>
int(1)
[8] =>
int(1)
}
</pre><pre>
derick@gargleblaster:/tmp/phpbug/vendor$ pe 7.2dev; php -dzend_extension=xdebug.so autoload.php
/tmp/phpbug/vendor/autoload.php:9:
array(3) {
[5] =>
int(1)
[7] =>
int(1)
[8] =>
int(1)
}
</pre><pre>
derick@gargleblaster:/tmp/phpbug/vendor$ pe 7.3dev; php -dzend_extension=xdebug.so autoload.php
/tmp/phpbug/vendor/autoload.php:9:
array(3) {
[5] =>
int(1)
[7] =>
int(1)
[8] =>
int(1)
</pre><pre>
derick@gargleblaster:/tmp/phpbug/vendor$ pe 7.4dev; php -dzend_extension=xdebug.so autoload.php
/tmp/phpbug/vendor/autoload.php:9:
array(3) {
[5] =>
int(1)
[7] =>
int(1)
[8] =>
int(1)
}
</pre>

Please upgrade PHP to a supported version.

jwos

2020-03-13 01:06

reporter   ~0005296

i'm afraid upgrading an old system is not so easy,

so the bug is in xdebug or in php internals?

if in xdebug, i may try to fix it

if in php internal, then i'll leave it alone

Issue History

Date Modified Username Field Change
2020-03-12 03:54 jwos New Issue
2020-03-12 03:54 jwos Tag Attached: coverage
2020-03-12 03:54 jwos File Added: autoload.php
2020-03-12 09:53 derick Assigned To => derick
2020-03-12 09:53 derick Status new => feedback
2020-03-12 09:53 derick Note Added: 0005282
2020-03-12 12:36 jwos File Added: phpbug.zip
2020-03-12 12:36 jwos Note Added: 0005283
2020-03-12 12:36 jwos Status feedback => assigned
2020-03-12 14:12 derick Status assigned => resolved
2020-03-12 14:12 derick Resolution open => won't fix
2020-03-12 14:12 derick Note Added: 0005284
2020-03-12 14:12 derick Description Updated
2020-03-12 14:13 derick Note Edited: 0005284
2020-03-13 01:06 jwos Note Added: 0005296