2017-10-05 118 views
4

我调试在我的PHP应用程序段错误,我编译PHP和--enable-debug选项和php-fpm的后段错误时转储核心,我跑:在gdb回溯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(不知道它是如何帮助)。

正如您所见,回溯中有??,根本没有任何帮助。这是应该如何?有什么方法可以获得真正的来电者吗?

回答

1

这是怎么回事?

有没有什么办法让真正的来电者?

也许。

您的堆栈跟踪指示/usr/local/sbin/php-fpm已完全剥离(已删除其符号表)。您可以使用file /usr/local/sbin/php-fpm进行确认。

make install完全去除二进制文件并不罕见。您应该尝试使用“as built”二进制文件(而不是“现在正在安装的”):gdb /path/to/build/tree/php-fpm core