Xdebug分段错误

时间:2014-12-24 15:39:56

标签: php linux wordpress magento xdebug

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

大约两周前,我们决定将公司的ubuntu网络服务器升级到最新版本。所以我们继续升级,一切似乎都非常顺利。直到我们尝试使用xdebug来调试magento应用程序。

我们在之前版本的ubuntu上有xdebug,并且能够毫无问题地完美调试。我们现在每次尝试调试Magento网站时都会出现分段错误错误。

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

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

我们使用Visual Studio和netbeans在我们的环境中进行调试。当我们启动调试会话时,它实际上最初在index.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
&#13;
&#13;
&#13;

正如您所看到的,客户端在第二次连接时超时。

手中有核心转储文件,我已经按照以下信息操作: http://sysadmin.carlusgg.com/?p=197

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

&#13;
&#13;
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
&#13;
&#13;
&#13;

现在我根本不是linux专家,但这让我很困惑。我们此时已尝试过以下事项: 试过xdebug版本2.2.3 - 2.2.6 卸载Ioncube 卸载了Zend OPCache 关闭PHP缓冲区输出。 尝试从头开始重新安装Xdebug 重新编译Apache 重新安装PHP 5.5 在iptables中打开端口 重新启动Web服务器

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

我的眼睛开始流血,因为我们正在了解我的linux知识。这个问题也有一个大问题。我们在同一台服务器上有WordPress站点。有时我们实际上能够成功调试整个WordPress会话。其他时候我们无法调试wordpress并遇到同样的问题。这使问题更加怪异。

任何人可能对我所遇到的问题提供的任何帮助都会令人惊讶。我现在几乎可以接受任何事情,因为这是我们的开发服务器。

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

1 个答案:

答案 0 :(得分:0)

目前还不清楚你是否真的试过没有ionCube运行 - 如果你不需要它 - 但是否则失败的原因很可能是ionCube加载器是incompatible with XDebug

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