2017-10-05 114 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