View Issue Details

IDProjectCategoryView StatusLast Update
0001304XdebugUsage problems (Wrong Results)public2017-01-03 18:55
ReporterjonashaagAssigned Toderick 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionunable to reproduce 
PlatformMacOSOS XOS Version
Product Version 
Target VersionFixed in Version 
Summary0001304: Segfault
DescriptionI don't have a minimal example to reproduce the crash, but I have used lldb to debug it. My findings are: Sometimes, xdebug_old_execute_ex(execute_data) will set op_array->filename to NULL (here: https://github.com/xdebug/xdebug/blob/606bf269d527a7c8c4b407f7c546df96b003670e/xdebug.c#L1893) and then xdebug_code_coverage_end_of_function(op_array) will crash when using strcmp on op_array->filename.
Additional InformationPHP 7.0.6 (cli) (built: Apr 29 2016 04:21:39) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
TagsNo tags attached.
Operating System
PHP Version7.0.5-7.0.9

Activities

jonashaag

2016-05-18 08:58

reporter   ~0003604

* thread #1: tid = 0x3d3d4a, 0x00007fff85fd3855 libsystem_platform.dylib`_platform_strcmp + 85, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
  * frame #0: 0x00007fff85fd3855 libsystem_platform.dylib`_platform_strcmp + 85
    frame #1: 0x00000001010aaf41 xdebug.so`xdebug_branch_info_mark_end_of_function_reached(filename=0x0000000000000018, function_name="{main}", key=0x0000000000000000, key_len=0) + 49 at xdebug_branch_info.c:417
    frame 0000002: 0x00000001010ac9fe xdebug.so`xdebug_code_coverage_end_of_function(op_array=0x0000000104286d20) + 206 at xdebug_code_coverage.c:1003
    frame 0000003: 0x00000001010a717f xdebug.so`xdebug_execute_ex(execute_data=0x000000010161c4f0) + 2671 at xdebug.c:1895
    frame 0000004: 0x0000000100396de8 php`zend_call_function + 1590
    frame 0000005: 0x00000001002adb22 php`zif_call_user_func_array + 255
    frame 0000006: 0x0000000100395804 php`dtrace_execute_internal + 129
    frame 0000007: 0x00000001010a756b xdebug.so`xdebug_execute_internal(current_execute_data=0x000000010161c470, return_value=0x000000010161c450) + 475 at xdebug.c:2035
    frame 0000008: 0x00000001003f3b55 php`ZEND_DO_FCALL_SPEC_HANDLER + 695
    frame 0000009: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000010: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000011: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x000000010161c370) + 2630 at xdebug.c:1890
    frame 0000012: 0x000000010041cf26 php`ZEND_CALL_TRAMPOLINE_SPEC_HANDLER + 1027
    frame 0000013: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000014: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000015: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x000000010161c370) + 2630 at xdebug.c:1890
    frame 0000016: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000017: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000018: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000019: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x000000010161c300) + 2630 at xdebug.c:1890
    frame 0000020: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000021: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000022: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000023: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x000000010161c020) + 2630 at xdebug.c:1890
    frame 0000024: 0x0000000100396de8 php`zend_call_function + 1590
    frame 0000025: 0x000000010022c1c5 php`zim_reflection_method_invokeArgs + 713
    frame 0000026: 0x0000000100395804 php`dtrace_execute_internal + 129
    frame 0000027: 0x00000001010a756b xdebug.so`xdebug_execute_internal(current_execute_data=0x000000010161bfa0, return_value=0x000000010161bd20) + 475 at xdebug.c:2035
    frame 0000028: 0x00000001003f3b55 php`ZEND_DO_FCALL_SPEC_HANDLER + 695
    frame 0000029: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000030: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000031: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x000000010161bb60) + 2630 at xdebug.c:1890
    frame 0000032: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000033: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000034: 0x000000010039573d php`dtrace_execute_ex + 238
    frame #35: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x000000010161b2a0) + 2630 at xdebug.c:1890
    frame 0000036: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000037: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000038: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000039: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x000000010161a940) + 2630 at xdebug.c:1890
    frame 0000040: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000041: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000042: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000043: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x000000010161a160) + 2630 at xdebug.c:1890
    frame 0000044: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000045: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000046: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000047: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x0000000101619ce0) + 2630 at xdebug.c:1890
    frame 0000048: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame #49: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000050: 0x000000010039573d php`dtrace_execute_ex + 238
    frame #51: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x0000000101619860) + 2630 at xdebug.c:1890
    frame 0000052: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000053: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000054: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000055: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x0000000101618630) + 2630 at xdebug.c:1890
    frame 0000056: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000057: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000058: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000059: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x0000000101618210) + 2630 at xdebug.c:1890
    frame 0000060: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000061: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000062: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000063: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x0000000101618120) + 2630 at xdebug.c:1890
    frame 0000064: 0x00000001003f3c78 php`ZEND_DO_FCALL_SPEC_HANDLER + 986
    frame 0000065: 0x00000001003e0f10 php`execute_ex + 25
    frame 0000066: 0x000000010039573d php`dtrace_execute_ex + 238
    frame 0000067: 0x00000001010a7156 xdebug.so`xdebug_execute_ex(execute_data=0x0000000101618030) + 2630 at xdebug.c:1890
    frame 0000068: 0x00000001003e1142 php`zend_execute + 544
    frame 0000069: 0x00000001003a46c2 php`zend_execute_scripts + 299
    frame 0000070: 0x000000010034ecc4 php`php_execute_script + 804
    frame 0000071: 0x000000010042eaaa php`do_cli + 3699
    frame 0000072: 0x000000010042daaa php`main + 1206
    frame 0000073: 0x00007fff9061b5ad libdyld.dylib`start + 1

jonashaag

2016-05-18 08:59

reporter   ~0003605

Note that in the traceback above, in frame #1, filename=0x0000000000000018 is actually STR_NAME_VAL(NULL).

derick

2016-12-12 00:03

administrator   ~0004021

Is this still a problem with the latest PHP (7.0.14) and Xdebug 2.5.0?

derick

2017-01-03 18:55

administrator   ~0004137

I could not reproduce this, and no feedback was given. I'm closing this issue, but feel free to reopen if this happens again.

Issue History

Date Modified Username Field Change
2016-05-18 08:57 jonashaag New Issue
2016-05-18 08:58 jonashaag Note Added: 0003604
2016-05-18 08:59 jonashaag Note Added: 0003605
2016-07-31 12:35 derick Category Debug client (console) => debugclient (debugging tool)
2016-07-31 12:35 derick Category debugclient (debugging tool) => (No Category)
2016-12-12 00:03 derick Note Added: 0004021
2016-12-12 00:03 derick Category (No Category) => Usage problems (Wrong Results)
2016-12-12 00:06 derick Assigned To => derick
2016-12-12 00:06 derick Status new => feedback
2017-01-03 18:55 derick Note Added: 0004137
2017-01-03 18:55 derick Status feedback => resolved
2017-01-03 18:55 derick Resolution open => unable to reproduce