PHP-FPM segfault error 6

5.4k Views Asked by At

i have a problem with php5-fpm. Very often it gets a segfault and is blocking the whole php processing, so no answer is serve to the client. For me the backtrace is looking like a infinite loop, but i don't see if it is cause by a script or an internal php module.

Is there any chance to see which script/module is involved?

The Segfault is always looking like that (dmesg output):

php5-fpm[1858]: segfault at 7fffa4de4fa0 ip 0000000000691515 sp 00007fffa4de4f90 error 6 in php5-fpm[400000+800000]

PHP Version:

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

Backtrace of Coredump:

(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 get Filename:

(gdb) print (char *)executor_globals.active_op_array->filename
Attempt to extract a component of a value that is not a structure.

Installed Packages:

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
1

There are 1 best solutions below

1
On

APC is compatible with PHP 5.5. You should disable it. However Opcache is included, so you can use that instead. I'm not sure if that will fix your problem, but could very well be the culprit.

Also some other things that might help- when does the segfault occur? When the process starts? Or when a request is made?