View Issue Details

IDProjectCategoryView StatusLast Update
0001386XdebugCode Coveragepublic2017-01-09 17:58
ReporterlordelphAssigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.5.0 
Target Version2.5.1Fixed in Version2.5.1 
Summary0001386: Overcoming coverage issues where executable code not shown as executed/executable
DescriptionThis is in reference to work done in the php-code-coverage issue 0000488 https://github.com/sebastianbergmann/php-code-coverage/issues/488

In particular, JoepRoebroek appeared to isolate this as xdebug using a bitfield flag which Zend is now using for other purposes. See https://github.com/sebastianbergmann/php-code-coverage/issues/488#issuecomment-269617008 for this discovery.

To follow up on this, I verified that the Zend ZEND_ACC_USE_GUARDS flag and the xdebug ZEND_XDEBUG_VISITED flag both use the same bit 0x1000000. This conflict is what appears to cause the anomalous results.

My suggestion is simple to use a different bit - 0x10000000. I searched the php source for all references to ce_flags, and audited which flags of the bitfield were in use. I concluded that 0x10000000 could be used. It is the same as another Zend constant ZEND_ACC_HAS_TYPE_HINTS, but this only used in fn_flags and not ce_flags

See my comment on the issue for more background https://github.com/sebastianbergmann/php-code-coverage/issues/488#issuecomment-271152897
Steps To ReproduceJoepRoebroek created a standalone method of reproducing the flaw here:

https://github.com/sebastianbergmann/php-code-coverage/issues/488#issuecomment-269082179
TagsNo tags attached.
Operating System
PHP Version7.0.10-7.0.14

Activities

derick

2017-01-09 17:58

administrator   ~0004168

Fixed in GIT. Thanks for the research!

Issue History

Date Modified Username Field Change
2017-01-08 16:49 lordelph New Issue
2017-01-08 19:45 derick Assigned To => derick
2017-01-08 19:45 derick Status new => assigned
2017-01-08 19:45 derick Fixed in Version => 2.5.1
2017-01-08 19:45 derick Target Version => 2.5.1
2017-01-09 17:58 derick Note Added: 0004168
2017-01-09 17:58 derick Status assigned => closed
2017-01-09 17:58 derick Resolution open => fixed