MantisBT - Xdebug
View Issue Details
0001117XdebugUsage problems (Wrong Results)public2015-02-26 16:032015-02-28 16:30
z0rc 
derick 
highcrashalways
closedfixed 
LinuxDebian7.6
2.3.1 
2.3.2 
5.5.20-5.5.25
0001117: phpunit with coverage reporting under 5.5.22 crashes xdebug
After upgrading from PHP 5.5.21 to 5.5.22 PHPUnit started to crash within xdebug module when used with coverage option. I tried with coverage-html and coverage-clover.

Tried with PHPUnit branches 3.7 and 4.5.

Sample output
# php vendor/bin/phpunit --configuration=phpunit.xml.dist
PHPUnit 4.5.0-16-geb6ad0d by Sebastian Bergmann and contributors.

Configuration read from /var/build/total_import/staging/135/phpunit.xml.dist

Deprecated configuration setting "strict" used

.......*** glibc detected *** php: realloc(): invalid next size: 0x00000000028518a0 ***

Full GDB stack trace https://privatepaste.com/280caa3907 [^]

Interesting is that under valgrind there is no crash, but there is some nasty errors (valgrind -v --leak-check=full php vendor/bin/phpunit --configuration=phpunit.xml.dist) https://privatepaste.com/bf998591bd [^]
phpunit --coverage-html
No tags attached.
txt valgrind_output.txt (56,546) 2015-02-26 16:04
https://bugs.xdebug.org/file_download.php?file_id=243&type=bug
txt gdb_output.txt (65,374) 2015-02-26 16:05
https://bugs.xdebug.org/file_download.php?file_id=244&type=bug
Issue History
2015-02-26 16:03z0rcNew Issue
2015-02-26 16:04z0rcFile Added: valgrind_output.txt
2015-02-26 16:05z0rcFile Added: gdb_output.txt
2015-02-26 16:06z0rcNote Added: 0003004
2015-02-26 16:18derickNote Added: 0003005
2015-02-26 16:18derickAssigned To => derick
2015-02-26 16:18derickStatusnew => feedback
2015-02-27 07:20z0rcNote Added: 0003006
2015-02-27 07:20z0rcStatusfeedback => assigned
2015-02-27 12:19bushmanNote Added: 0003012
2015-02-27 12:39derickNote Added: 0003013
2015-02-27 12:53bushmanNote Added: 0003014
2015-02-28 16:30derickNote Added: 0003016
2015-02-28 16:30derickStatusassigned => closed
2015-02-28 16:30derickResolutionopen => fixed
2015-02-28 16:30derickFixed in Version => 2.3.2
2016-07-31 13:36derickCategoryUsage problems => Usage problems (Crashes)
2016-07-31 13:38derickCategoryUsage problems (Crashes) => Usage problems (Wrong Results)

Notes
(0003004)
z0rc   
2015-02-26 16:06   
Here are similar reports https://github.com/puphpet/puphpet/issues/1368 [^]
(0003005)
derick   
2015-02-26 16:18   
Is this with all code coverage, or just some specific ones? Could you for example make a small reproducible case (ie, one specific unit test), that shows this crash?
(0003006)
z0rc   
2015-02-27 07:20   
I've hit this issue with two internal projects. Will try to come up with some small testcase.
(0003012)
bushman   
2015-02-27 12:19   
Hi, I created reproducible case:
https://github.com/teplolog/xdebub_realloc_error/blob/master/tests/XdebugTest.php [^]
(0003013)
derick   
2015-02-27 12:39   
Thanks bushman, how do I run that? Just in a dir with phpunit?
(0003014)
bushman   
2015-02-27 12:53   
You can install this case project by running:
git clone https://github.com/teplolog/xdebub_realloc_error.git [^]
cd xdebub_realloc_error
composer install

And then run:
php ./vendor/bin/phpunit --configuration=phpunit.xml.dist
(0003016)
derick   
2015-02-28 16:30   
Thanks for the reproduce case. This is now fixed on GIT - for the 2.3.2 release.