View Issue Details

IDProjectCategoryView StatusLast Update
0001334XdebugStacktracespublic2016-08-03 08:19
Reporterbluewind Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionno change required 
PlatformLinuxOSArch LinuxOS Versionn/a
Product Version2.4.0 
Fixed in Version2.4.1 
Summary0001334: Crash when using xdebug_start_code_coverage(XDEBUG_CC_UNUSED) with php -S
Description

When collecting code coverage information with XDEBUG_CC_UNUSED enabled, the php dev webserver (also php-fpm) crashes.

I discovered this by trying to collect coverage data from my test suite which uses the php server to test actual API requests sent to my application. The backtrace looks different, but removing XDEBUG_CC_UNUSED in my test suite also fixes the problem. I'm not entirely certain if it is the actual bug I'm hitting though since I don't need to issue 2 requests when I hit this in my application.

Running the example without XDEBUG_CC_UNUSED works just fine.

Steps To Reproduce

echo '<?php xdebug_start_code_coverage(XDEBUG_CC_UNUSED);' > test.php
php -S 127.0.0.1:8080 &
sleep 1
curl http://127.0.0.1:8080/test.php
curl http://127.0.0.1:8080/test.php # yes, twice

Additional Information

Error in `php': double free or corruption (out): 0x000000000154bb40
======= Backtrace: =========
/usr/lib/libc.so.6(+0x6ed4b)[0x7f9fa11eed4b]
/usr/lib/libc.so.6(+0x74546)[0x7f9fa11f4546]
/usr/lib/libc.so.6(+0x74d1e)[0x7f9fa11f4d1e]
/usr/lib/php/modules/xdebug.so(xdebug_path_info_dtor+0x38)[0x7f9fa00878b8]
/usr/lib/php/modules/xdebug.so(zm_post_zend_deactivate_xdebug+0x245)[0x7f9fa0083a15]
php(zend_post_deactivate_modules+0x2a)[0x69072a]
php(php_request_shutdown+0x485)[0x629155]
php[0x726fb2]
php[0x7275ae]
php[0x728490]
php[0x432b87]
/usr/lib/libc.so.6(__libc_start_main+0xf1)[0x7f9fa11a0741]
php(_start+0x29)[0x432d89]
======= Memory map: ========
[...]

Jul 31 15:38:07 Marin systemd-coredump[6924]: Process 6914 (php) of user 1000 dumped core.

                                          Stack trace of thread 6914: 
                                          #0  0x00007f9fa11b3295 raise (libc.so.6) 
                                          #1  0x00007f9fa11b46da abort (libc.so.6) 
                                          #2  0x00007f9fa11eed50 __libc_message (libc.so.6) 
                                          #3  0x00007f9fa11f4546 malloc_printerr (libc.so.6) 
                                          #4  0x00007f9fa11f4d1e _int_free (libc.so.6) 
                                          #5  0x00007f9fa00878b8 xdebug_path_info_dtor (xdebug.so) 
                                          #6  0x00007f9fa0083a15 zm_post_zend_deactivate_xdebug (xdebug.so) 
                                          #7  0x000000000069072a zend_post_deactivate_modules (php) 
                                          #8  0x0000000000629155 php_request_shutdown (php) 
                                          #9  0x0000000000726fb2 n/a (php) 
                                          #10 0x00000000007275ae n/a (php) 
                                          #11 0x0000000000728490 n/a (php) 
                                          #12 0x0000000000432b87 n/a (php) 
                                          #13 0x00007f9fa11a0741 __libc_start_main (libc.so.6) 
                                          #14 0x0000000000432d89 _start (php) 
TagsNo tags attached.
Operating SystemArch Linux
PHP Version7.0.5-7.0.9

Activities

derick

2016-08-02 18:45

administrator   ~0003663

Could you try Xdebug 2.4.1 please? It is possible that that fixes your problem.

bluewind

2016-08-02 19:00

reporter   ~0003664

2.4.1 fixes the problem, yes. Thanks!

derick

2016-08-03 08:19

administrator   ~0003665

Perfect, closing this out then.

Issue History

Date Modified Username Field Change
2016-07-31 13:46 bluewind New Issue
2016-08-02 18:45 derick Note Added: 0003663
2016-08-02 18:45 derick Assigned To => derick
2016-08-02 18:45 derick Status new => feedback
2016-08-02 19:00 bluewind Note Added: 0003664
2016-08-02 19:00 bluewind Status feedback => assigned
2016-08-03 08:19 derick Note Added: 0003665
2016-08-03 08:19 derick Status assigned => resolved
2016-08-03 08:19 derick Fixed in Version => 2.4.1
2016-08-03 08:19 derick Resolution open => no change required