我有php5-fpm的问题.通常它会出现段错误并阻止整个php处理,因此无法为客户端提供任何答案.
对我来说,回溯看起来像一个无限循环,但我不知道它是由脚本或内部php模块引起的.
有没有机会看到涉及哪个脚本/模块?
Segfault总是看起来像那样(dmesg输出):
php5-fpm[1858]: segfault at 7fffa4de4fa0 ip 0000000000691515 sp 00007fffa4de4f90 error 6 in php5-fpm[400000+800000]
PHP版本:
php -v
PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul 2 2015 15:23:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
Coredump的Backtrace:
(gdb) bt
#0 0x0000000000691515 in ?? ()
#1 0x0000000000692a64 in vspprintf ()
#2 0x0000000000707359 in zend_spprintf ()
#3 0x00000000006e4a46 in _convert_to_string ()
#4 0x0000000000725859 in ?? ()
#5 0x0000000000717668 in execute_ex ()
#6 0x00000000006dd7c9 in dtrace_execute_ex ()
#7 0x000000000079df80 in ?? ()
#8 0x0000000000717668 in execute_ex ()
#9 0x00000000006dd7c9 in dtrace_execute_ex ()
#10 0x000000000079df80 in ?? ()
#11 0x0000000000717668 in execute_ex ()
#12 0x00000000006dd7c9 in dtrace_execute_ex ()
#13 0x000000000079df80 in ?? ()
#14 0x0000000000717668 in execute_ex ()
#15 0x00000000006dd7c9 in dtrace_execute_ex ()
#16 0x000000000079df80 in ?? ()
#17 0x0000000000717668 in execute_ex ()
#18 0x00000000006dd7c9 in dtrace_execute_ex ()
#19 0x000000000079df80 in ?? ()
#20 0x0000000000717668 in execute_ex ()
#21 0x00000000006dd7c9 in dtrace_execute_ex ()
#22 0x000000000079df80 in ?? ()
#23 0x0000000000717668 in execute_ex ()
#24 0x00000000006dd7c9 in dtrace_execute_ex ()
#25 0x000000000079df80 in ?? ()
#26 0x0000000000717668 in execute_ex ()
#27 0x00000000006dd7c9 in dtrace_execute_ex ()
#28 0x000000000079df80 in ?? ()
#29 0x0000000000717668 in execute_ex ()
#30 0x00000000006dd7c9 in dtrace_execute_ex ()
#31 0x000000000079df80 in ?? ()
#32 0x0000000000717668 in execute_ex ()
#33 0x00000000006dd7c9 in dtrace_execute_ex ()
#34 0x000000000079df80 in ?? ()
#35 0x0000000000717668 in execute_ex ()
#36 0x00000000006dd7c9 in dtrace_execute_ex ()
#37 0x000000000079df80 in ?? ()
#38 0x0000000000717668 in execute_ex ()
#39 0x00000000006dd7c9 in dtrace_execute_ex ()
#40 0x000000000079df80 in ?? ()
#41 0x0000000000717668 in execute_ex ()
#42 0x00000000006dd7c9 in dtrace_execute_ex ()
#43 0x000000000079df80 in ?? ()
#44 0x0000000000717668 in execute_ex ()
#45 0x00000000006dd7c9 in dtrace_execute_ex ()
#46 0x000000000079df80 in ?? ()
(...)
#68150 0x0000000000717668 in execute_ex ()
#68151 0x00000000006dd7c9 in dtrace_execute_ex ()
#68152 0x000000000079df80 in ?? ()
#68153 0x0000000000717668 in execute_ex ()
#68154 0x00000000006dd7c9 in dtrace_execute_ex ()
#68155 0x000000000079df80 in ?? ()
#68156 0x0000000000717668 in execute_ex ()
#68157 0x00000000006dd7c9 in dtrace_execute_ex ()
#68158 0x000000000079cec1 in ?? ()
#68159 0x0000000000717668 in execute_ex ()
#68160 0x00000000006dd7c9 in dtrace_execute_ex ()
#68161 0x00000000006ef250 in zend_execute_scripts ()
#68162 0x000000000068f065 in php_execute_script ()
#68163 0x0000000000463b00 in main ()
Backtrace获取文件名:
(gdb) print (char *)executor_globals.active_op_array->filename
Attempt to extract a component of a value that is not a structure.
安装包:
dpkg -l | grep php
ii php5-apcu 4.0.2-2build1 amd64 APC User Cache for PHP 5
ii php5-cli 5.5.9+dfsg-1ubuntu4.11 amd64 command-line interpreter for the php5 scripting language
ii php5-common 5.5.9+dfsg-1ubuntu4.11 amd64 Common files for packages built from the php5 source
ii php5-curl 5.5.9+dfsg-1ubuntu4.11 amd64 CURL module for php5
ii php5-fpm 5.5.9+dfsg-1ubuntu4.11 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php5-gd 5.5.9+dfsg-1ubuntu4.11 amd64 GD module for php5
ii php5-json 1.3.2-2build1 amd64 JSON module for php5
ii php5-mcrypt 5.4.6-0ubuntu5 amd64 MCrypt module for php5
ii php5-mysqlnd 5.5.9+dfsg-1ubuntu4.11 amd64 MySQL module for php5 (Native Driver)
ii php5-readline 5.5.9+dfsg-1ubuntu4.11 amd64 Readline module for php5
解决方法:
APC与PHP 5.5兼容.你应该禁用它.但是包含Opcache,所以你可以使用它.我不确定这是否能解决你的问题,但很可能是罪魁祸首.
还有一些其他可能有用的东西 – 何时发生段错误?这个过程何时开始?或者在提出请求时?