View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000670Xdebug(No Category)public2011-03-09 00:292011-03-10 15:35
Assigned Toderick 
PlatformLinuxOSUbuntu OS Version10.10
Product Version2.1.0 
Target VersionFixed in Version 
Summary0000670: Segfault in Xdebug when used for code coverage with PHPUnit
DescriptionDisclaimer: I can't see a way to re-open 0000661, so logging this. Annoying, I know.

Steps To Reproduce1. built PHP 5.3.5 with --enable-debug
2. installed Xdebug and PHPUnit via pear / pecl
3. ran my unit tests using gdb, specifically a particular test that uses the Rediska redis client: [^]

PHP *always* segfaults, the backtrace from gdb seems to implicate xdebug code:

#0 0x00007ffff611c5c3 in xdebug_set_in_ex (set=0x1f52a60, position=1189155543, noisy=1) at /tmp/pear/temp/xdebug/xdebug_set.c:72
#1 0x00007ffff610abbe in xdebug_analyse_branch (opa=0x1f37638, position=1189155543, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:390
0000002 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=133, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000003 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=131, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000004 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=129, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000005 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=119, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000006 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=114, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000007 0x00007ffff610ac5d in xdebug_analyse_branch (opa=0x1f37638, position=111, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:410
0000008 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=101, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000009 0x00007ffff610ac5d in xdebug_analyse_branch (opa=0x1f37638, position=88, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:410
0000010 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=85, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000011 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=79, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000012 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=78, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000013 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=74, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000014 0x00007ffff610ac5d in xdebug_analyse_branch (opa=0x1f37638, position=44, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:410
0000015 0x00007ffff610ac5d in xdebug_analyse_branch (opa=0x1f37638, position=35, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:410
0000016 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=31, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000017 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=27, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000018 0x00007ffff610ac21 in xdebug_analyse_branch (opa=0x1f37638, position=18, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:408
0000019 0x00007ffff610ac5d in xdebug_analyse_branch (opa=0x1f37638, position=6, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:410
0000020 0x00007ffff610ad5a in xdebug_analyse_oparray (opa=0x1f37638, set=0x1f52a60) at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:444
0000021 0x00007ffff610ae92 in prefill_from_oparray (fn=0x1dd1428 "/data/redis/Rediska/library/Rediska/KeyDistributor/ConsistentHashing.php", opa=0x1f37638)
    at /tmp/pear/temp/xdebug/xdebug_code_coverage.c:473

( more lines after this, see file attachement )

Additional InformationThe PHP file that seems to cause this crash is: [^]

export USE_ZEND_ALLOC=0 mitigates this issue, so it should be closed, but either this is a bug in PHP (?) *or* Xdebug is not functioning.
TagsNo tags attached.
Operating System
PHP Version5.3.5
Attached Filestxt file icon xdebug_rediska_phpunit_coverage_crash.txt [^] (23,211 bytes) 2011-03-09 00:29 [Show Content]

- Relationships

-  Notes
derick (administrator)
2011-03-09 21:39


I've good news and bad news. The good news is that I can fix this easily, and a fix will make its way into SVN soon. The bad news is that you have a bug in your code that makes Xdebug crash ;-)

Line 146 of ConsistentHashing.php, has:

145 if ($looped) {
146 break 2;
147 }

You can't do "break 2" there, because you're only in one nested loop (the while on line 120).

canuckistani (reporter)
2011-03-09 22:47

Sweet! I was too code-blind to see that yesterday reading the rediska code ( which isn't mine anyway ). I'll address that issue one the Rediska github repo.
derick (administrator)
2011-03-10 15:35

Fixed in SVN for 2.1.1 and 2.2.0

- Issue History
Date Modified Username Field Change
2011-03-09 00:29 canuckistani New Issue
2011-03-09 00:29 canuckistani File Added: xdebug_rediska_phpunit_coverage_crash.txt
2011-03-09 21:39 derick Note Added: 0001682
2011-03-09 22:47 canuckistani Note Added: 0001683
2011-03-10 15:35 derick Note Added: 0001684
2011-03-10 15:35 derick Status new => closed
2011-03-10 15:35 derick Assigned To => derick
2011-03-10 15:35 derick Resolution open => fixed
2016-07-31 13:35 derick Category Debug client (console) => debugclient (debugging tool)
2016-07-31 13:35 derick Category debugclient (debugging tool) => (No Category)

Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker