Xdebug 分段错误


Xdebug Segmentation Fault

所以首先我想说的是,我们已经连续研究了这个问题 4 天,试图找出解决方案,但无法找到有效的答案。

因此,大约两周前,作为一家公司,我们决定是时候将我们的 ubuntu Web 服务器升级到最新版本了。所以我们继续进行升级,一切似乎都非常顺利。直到我们尝试使用 xdebug 来调试 magento 应用程序。

我们在以前版本的 ubuntu 上安装了 xdebug,并且能够完美地调试而不会出现任何问题。现在,每次尝试调试Magento网站时,我们都会收到分段错误错误。

您可以在下面的 pastebin 链接中看到我们的 php.ini 文件。我们还有一个本地 php 覆盖,具有以下选项:xdebug.remote_host = 本地计算机IPxdebug.remote_port = 9001

PHP ini 文件 http://pastebin.com/UYLviByW

我们使用Visual Studio和netbeans在我们的环境中进行调试。当我们启动调试会话时,它实际上最初在索引.php文件上中断。我们可以逐步完成该过程一段时间,直到应用程序的随机点。此时,将在 apache2 日志文件中创建分段错误,如下所示:

[Tue Dec 23 16:09:25.756786 2014] [core:notice] [pid 31832] AH00051: child pid 31838 exit signal Segmentation fault (11), possible coredump in /etc/apache2

如您所见,发生了核心转储。我们还得到了显示在 xdebug 日志文件中的以下内容:

Log opened at 2014-12-23 18:30:11
I: Connecting to configured address/port: 10.10.10.144:9001.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/magento.dev.com/public_html/index.php" language="PHP" protocol_version="1.0" appid="15222" idekey="netbeans-xdebug"><engine version="2.2.6"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>
Log opened at 2014-12-23 18:30:36
I: Connecting to configured address/port: 10.10.10.144:9001.
E: Time-out connecting to client. :-(
Log closed at 2014-12-23 18:30:36

如您所见,客户端在第二次连接时超时。

有了核心转储文件,我遵循了以下信息:http://sysadmin.carlusgg.com/?p=197 和

因此,通过核心转储的堆栈跟踪,我得到以下输出。

Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from apache2...Reading symbols from /usr/lib/debug//usr/sbin/apache2...done.
done.
[New LWP 32601]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
warning: the debug information found in "/usr/lib/debug//usr/lib/php5/20121212/mysql.so" does not match "/usr/lib/php5/20121212/mysql.so" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug/usr/lib/php5/20121212/mysql.so" does not match "/usr/lib/php5/20121212/mysql.so" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug//usr/lib/php5/20121212/mysqli.so" does not match "/usr/lib/php5/20121212/mysqli.so" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug/usr/lib/php5/20121212/mysqli.so" does not match "/usr/lib/php5/20121212/mysqli.so" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug//usr/lib/php5/20121212/pdo_mysql.so" does not match "/usr/lib/php5/20121212/pdo_mysql.so" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug/usr/lib/php5/20121212/pdo_mysql.so" does not match "/usr/lib/php5/20121212/pdo_mysql.so" (CRC mismatch).
Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  xdebug_add_stack_frame (zdata=zdata@entry=0x7f6757eec398, op_array=op_array@entry=0x7f6759f54e80, type=type@entry=2) at /home/icstech/xdebug-2.2.5/xdebug_stack.c:1112
1112                                    tmp->var[tmp->varc].name = NULL;
(gdb) bt
#0  xdebug_add_stack_frame (zdata=zdata@entry=0x7f6757eec398, op_array=op_array@entry=0x7f6759f54e80, type=type@entry=2) at /home/icstech/xdebug-2.2.5/xdebug_stack.c:1112
#1  0x00007f67510e8dcc in xdebug_execute_ex (execute_data=0x7f6757eec4e8) at /home/icstech/xdebug-2.2.5/xdebug.c:1372
#2  0x00007f675138e0aa in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#3  0x00007f6751386a30 in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#4  0x00007f675138a127 in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#5  0x00007f675138e0aa in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#6  0x00007f6751386a30 in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#7  0x00007f675138a127 in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#8  0x00007f675138e0aa in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#9  0x00007f6751386a30 in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#10 0x00007f675138a127 in ?? () from /usr/local/ioncube/ioncube_loader_lin_5.5.so
#11 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eebc80) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#12 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eebc80) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#13 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#14 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eebc80) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#15 0x00007f6753ec2ea1 in zend_call_function (fci=fci@entry=0x7fff4adeef50, fci_cache=<optimized out>, fci_cache@entry=0x7fff4adeef20)
    at /build/buildd/php5-5.5.9+dfsg/Zend/zend_execute_API.c:939
#16 0x00007f6753df6592 in zif_call_user_func_array (ht=<optimized out>, return_value=0x7f675afb27d8, return_value_ptr=<optimized out>, this_ptr=<optimized out>,
    return_value_used=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/ext/standard/basic_functions.c:4806
#17 0x00007f6753ec0c6b in dtrace_execute_internal (execute_data_ptr=<optimized out>, fci=<optimized out>, return_value_used=<optimized out>)
    at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:97
#18 0x00007f67510e9a46 in xdebug_execute_internal (current_execute_data=0x7f6757eeba70, fci=0x0, return_value_used=0) at /home/icstech/xdebug-2.2.5/xdebug.c:1551
#19 0x00007f6753f80cc5 in zend_do_fcall_common_helper_SPEC (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:552
#20 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeba70) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#21 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#22 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeba70) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#23 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeb8e8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
---Type <return> to continue, or q <return> to quit---
#24 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeb8e8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#25 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#26 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeb8e8) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#27 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeb788) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#28 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeb788) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#29 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#30 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeb788) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#31 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeb628) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#32 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeb628) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#33 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#34 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeb628) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#35 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeb4c0) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#36 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeb4c0) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#37 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#38 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeb4c0) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#39 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeb2a8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#40 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeb2a8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#41 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#42 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeb2a8) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#43 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeb170) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#44 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeb170) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#45 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#46 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeb170) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#47 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeb068) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#48 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeb068) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#49 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#50 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeb068) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
---Type <return> to continue, or q <return> to quit---
#51 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeae90) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#52 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeae90) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#53 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#54 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeae90) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#55 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeac80) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#56 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeac80) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#57 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#58 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeac80) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#59 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eeab30) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#60 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eeab30) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#61 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#62 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eeab30) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#63 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eea9d8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#64 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eea9d8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#65 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#66 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eea9d8) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#67 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eea838) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#68 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eea838) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#69 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#70 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eea838) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#71 0x00007f6753f81310 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6757eea6f8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:584
#72 0x00007f6753efa9f8 in execute_ex (execute_data=0x7f6757eea6f8) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_vm_execute.h:363
#73 0x00007f6753ec0b69 in dtrace_execute_ex (execute_data=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/Zend/zend_dtrace.c:73
#74 0x00007f67510e8fcc in xdebug_execute_ex (execute_data=0x7f6757eea6f8) at /home/icstech/xdebug-2.2.5/xdebug.c:1437
#75 0x00007f6753ed25f0 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /build/buildd/php5-5.5.9+dfsg/Zend/zend.c:1316
#76 0x00007f6753e724d5 in php_execute_script (primary_file=primary_file@entry=0x7fff4adf3240) at /build/buildd/php5-5.5.9+dfsg/main/main.c:2506
#77 0x00007f6753f8294a in php_handler (r=<optimized out>) at /build/buildd/php5-5.5.9+dfsg/sapi/apache2handler/sapi_apache2.c:667
---Type <return> to continue, or q <return> to quit---
#78 0x00007f6758061680 in ap_run_handler (r=0x7f6757eca0a0) at config.c:169
#79 0x00007f6758061bc9 in ap_invoke_handler (r=r@entry=0x7f6757eca0a0) at config.c:439
#80 0x00007f675807716a in ap_process_async_request (r=0x7f6757eca0a0) at http_request.c:317
#81 0x00007f6758077444 in ap_process_request (r=r@entry=0x7f6757eca0a0) at http_request.c:363
#82 0x00007f6758073f02 in ap_process_http_sync_connection (c=0x7f6757ed0290) at http_core.c:190
#83 ap_process_http_connection (c=0x7f6757ed0290) at http_core.c:231
#84 0x00007f675806acc0 in ap_run_process_connection (c=0x7f6757ed0290) at connection.c:41
#85 0x00007f675806b0a8 in ap_process_connection (c=c@entry=0x7f6757ed0290, csd=<optimized out>) at connection.c:202
#86 0x00007f67548a2767 in child_main (child_num_arg=child_num_arg@entry=3) at prefork.c:704
#87 0x00007f67548a29a6 in make_child (s=0x7f6757fd0de0, slot=slot@entry=3) at prefork.c:800
#88 0x00007f67548a2a06 in startup_children (number_to_start=2) at prefork.c:818
#89 0x00007f67548a36e0 in prefork_run (_pconf=<optimized out>, plog=0x7f6757fcc028, s=0x7f6757fd0de0) at prefork.c:976
#90 0x00007f675804869e in ap_run_mpm (pconf=0x7f6757ffe028, plog=0x7f6757fcc028, s=0x7f6757fd0de0) at mpm_common.c:96
#91 0x00007f6758041e36 in main (argc=3, argv=0x7fff4adf3968) at main.c:777

现在我根本不是Linux专家,但这让我感到困惑。此时,我们已经尝试了以下方法:尝试过 xdebug 版本 2.2.3 - 2.2.6已卸载的离子立方体卸载的Zend OPCache已关闭 PHP 缓冲区输出。尝试从头开始重新安装 Xdebug重新编译的阿帕奇重新安装的 PHP 5.5已打开 iptables 中的端口已重新启动 Web 服务器

现在让我解释一下我们的服务器设置。这是我们本地网络的内部开发服务器。它安装了 ubuntu 14.04。内部和外部的所有防火墙端口都为端口正确打开。这是在电源服务器上运行的虚拟机。

我的

眼睛开始流血,因为我们即将了解我的 linux 知识。这个问题还有一个很大的问题。我们在同一台服务器上有WordPress网站。有时我们实际上能够通过WordPress的整个会话成功调试。其他时候,我们无法调试wordpress并遇到相同的问题。这使得问题更加诡异。

任何人对我遇到的问题的任何帮助都会很棒。我现在对任何事情都持开放态度,因为这是我们的开发服务器。

如果您需要任何其他信息来帮助解决此问题,请告诉我。现在,我们将返回到var_dump和print_r调试方法。

目前还不清楚你是否真的尝试过在没有ionCube的情况下运行 - 如果你不需要它 - 但失败的原因很可能是ionCube加载器与XDebug不兼容。

我很幸运地使用 XDebug 在 5.4 上调试了部分 ionCube 加密的应用程序,但在 PHP 5.6 上我遇到了类似的分段错误。