如何解决如何为php分段错误提供更详细的回溯? 更多详细信息
我的PHP代码中出现了segmentation fault
。
有了gdb,我没有得到太多信息。有没有办法为PHP细分错误获取更详细的回溯?
更多详细信息
我正在使用Laravel作为框架。我从predis
切换到phpredis
。从那时起,我在使用Redis的代码上遇到分段错误。
我用brew和this tutorial安装了gdb。
但是,当我运行以下命令时:gdb --args php /Users/someuser/app/vendor/bin/phpunit /Users/someuser/app/Unit/Redis/RedisTest.php
我收到消息:
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation,Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY,to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin19.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions,please see:
<http://www.gnu.org/software/gdb/bugs/>.
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 php...
(No debugging symbols found in php)
(gdb) r
Starting program: /usr/local/bin/php /Users/someuser/app/vendor/bin/phpunit /Users/someuser/app/tests/Unit/Redis/RedisTest.php
[New Thread 0x2503 of process 1587]
[New Thread 0x2203 of process 1587]
warning: unhandled dyld version (16)
PHPUnit 9.2.5 by Sebastian Bergmann and contributors.
.
Thread 2 received signal SIGSEGV,Segmentation fault.
0x0000000103ec7184 in ?? ()
(gdb)
如何从0x0000000103ec7184 in ?? ()
的最后一行中获取更多详细信息?
也许我走错了路,我需要以其他方式调试错误吗? (我已经尝试过xdebug,但这只向我显示了调用redis之前的最后一条命令。)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。