PHP-FPM段错误6

我有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,所以你可以使用它.我不确定这是否能解决你的问题,但很可能是罪魁祸首.

还有一些其他可能有用的东西 – 何时发生段错误?这个过程何时开始?或者在提出请求时?

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...