PHP-gdb 回溯中的 FPM 未知调用者
PHP-FPM unknown caller in gdb backtrace
我正在我的 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 ?? ()
我还把 php 来源的 .gdbinit
放到有核心文件的目录,并将 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
已完全剥离(已删除其符号 table)。您可以通过 file /usr/local/sbin/php-fpm
.
确认这一点
make install
完全剥离二进制文件的情况并不少见。您应该尝试使用 "as built" 二进制文件(而不是您现在使用的 "as installed"):gdb /path/to/build/tree/php-fpm core
.
我正在我的 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 ?? ()
我还把 php 来源的 .gdbinit
放到有核心文件的目录,并将 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
已完全剥离(已删除其符号 table)。您可以通过 file /usr/local/sbin/php-fpm
.
make install
完全剥离二进制文件的情况并不少见。您应该尝试使用 "as built" 二进制文件(而不是您现在使用的 "as installed"):gdb /path/to/build/tree/php-fpm core
.