gdb中的PHP-FPM未知调用者回溯

我在我的php应用程序中调试了一个段错误,我使用–enable-debug选项编译了php,并且在段落错误期间php-fpm转储了核心后,我运行:

$gdb /usr/local/sbin/php-fpm core
GNU gdb (GDB) 7.12.1

Copyright (C) 2017 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-alpine-linux-musl".
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 /usr/local/sbin/php-fpm...(no debugging symbols found)...done.
[New LWP 2110]

warning: Can't read pathname for load map: No error information.
Core was generated by `php-fpm:'.
Program terminated with signal SIGBUS, Bus error.
#0  0x000055c27ba1f291 in ?? ()
(gdb) bt
#0  0x000055c27ba1f291 in ?? ()
#1  0x000055c27ba21bce in _efree ()
#2  0x000055c27ba6c8b2 in ?? ()
#3  0x000055c27ba70cee in zend_array_destroy ()
#4  0x000055c27ba56fbd in _zval_dtor_func ()
#5  0x000055c27ba6cce4 in ?? ()
#6  0x000055c27ba70cc8 in zend_array_destroy ()
#7  0x000055c27ba56fbd in _zval_dtor_func ()
#8  0x000055c27ba6cce4 in ?? ()
#9  0x000055c27ba70c8a in zend_array_destroy ()
#10 0x000055c27ba56fbd in _zval_dtor_func ()
#11 0x000055c27ba6cce4 in ?? ()
#12 0x000055c27ba70cc8 in zend_array_destroy ()
#13 0x000055c27ba56fbd in _zval_dtor_func ()
#14 0x000055c27ba44b75 in ?? ()
#15 0x000055c27ba450fe in zend_cleanup_user_class_data ()
#16 0x000055c27ba3f473 in ?? ()
#17 0x000055c27ba5971b in zend_deactivate ()
#18 0x000055c27b9bf1df in php_request_shutdown ()
#19 0x000055c27bb55015 in ?? ()
#20 0x00007f7fb743e964 in __libc_start_main () from /lib/ld-musl-x86_64.so.1
#21 0x0000000000000000 in ?? ()

我还将.gdbinit从php源文件放到带有核心文件的目录中,并将set auto-load safe-path /设置为〜/ .gdbinit(不知道它有多帮助).

你可以看到有??在回溯中根本没用.这应该是怎么回事?有没有办法让真正的来电者?

最佳答案

Is this how it should be?

没有.

Is there any way to get the real caller?

大概.

堆栈跟踪表明/usr/local/sbin / php-fpm已完全剥离(删除了符号表).您可以使用文件/usr/local/sbin / php-fpm进行确认.

make install完全剥离二进制文件的情况并不少见.您应该尝试使用“as built”二进制文件(而不是您现在正在执行的“已安装”):gdb / path / to / build / tree / php-fpm core.

点赞