Learn about Centmin Mod LEMP Stack today
Become a Member

PHP-FPM SegFault every few seconds

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by ethanpil, Jan 18, 2016.

  1. ethanpil

    ethanpil Active Member

    168
    47
    28
    Nov 8, 2015
    Ratings:
    +87
    Local Time:
    3:40 PM
    I am using an beta 1.2.3-eva2000.09 build from two days ago... I have experienced some web server hang ups, and doing a little digging, I now see this:

    Code:
    [root@xxxxxx ~]# tail /var/log/messages
    Jan 18 00:52:26 li731-227 kernel: php-fpm[20510]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:52:37 li731-227 kernel: php-fpm[20511]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:52:48 li731-227 kernel: php-fpm[20512]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:52:59 li731-227 kernel: php-fpm[20516]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:53:10 li731-227 kernel: php-fpm[20517]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:53:21 li731-227 kernel: php-fpm[20518]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:53:40 li731-227 kernel: php-fpm[20519]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:53:51 li731-227 kernel: php-fpm[20520]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:54:02 li731-227 kernel: php-fpm[20523]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    Jan 18 00:54:13 li731-227 kernel: php-fpm[20524]: segfault at 53064e0 ip 00000000009025e3 sp 00007fff3edd0fc0 error 4 in php-fpm[400000+927000]
    
    I googled the 400000+927000 error and some various php bugs come up,related to memcached, etc., but they are all 5.3 or 5.4 branch related, but here were in the 5.5 branch...

    Linode default Centos 7 distro
    Code:
    [root@xxxx~]# uname -a
    Linux xxxxxx 4.1.5-x86_64-linode61 #7 SMP Mon Aug 24 13:46:31 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
    
    How can I debug this?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    3:40 PM
    Nginx 1.13.x
    MariaDB 5.5
    Some tips and info at PHP-FPM - WARNING: failed processes threshold (10 in 60 sec) is reached, initiating reload Errors :)

    PHP is segfaulting and hitting it's limits with your specific php web application so you need to debug your php server. What are segfaults = Why Does The Segmentation Fault Occur on Linux / UNIX Systems?

    Examples with strace below:
    With gdb backtrace and PHP debug compiled mode where centmin.sh has a PHPDEBUGMODE variable which you can set to PHPDEBUGMODE=y and recompile php via centmin.sh menu option 5 to enable debug mode for PHP-FPM. After troubleshooting set PHPDEBUGMODE=n and recompile php via centmin.sh menu option 5 again to disable debug mode.
    Code:
    PHPDEBUGMODE=n # --enable-debug PHP compile flag
    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such.

    You'll need to tune your PHP-FPM settings and this is left up to end user to do but here's a thread for starters to enable php status page output outlined at PHP-FPM - CentminMod.com LEMP Nginx web stack for CentOS and PHP-FPM - pm.max_children | Centmin Mod Community which outlines the official PHP-FPM config documentation as well.
     
    Last edited: Jan 18, 2016
  3. ethanpil

    ethanpil Active Member

    168
    47
    28
    Nov 8, 2015
    Ratings:
    +87
    Local Time:
    3:40 PM
    Not sure the cause here, but I went into /etc/centminmod/php.d and disabled memcached, memcache and redis since I a dont use them and it went away.
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    3:40 PM
    Nginx 1.13.x
    MariaDB 5.5
    You can probably pin point which by enabling one at a time again and see which one
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    3:40 PM
    Nginx 1.13.x
    MariaDB 5.5
  6. ethanpil

    ethanpil Active Member

    168
    47
    28
    Nov 8, 2015
    Ratings:
    +87
    Local Time:
    3:40 PM
    I tried one at a time but it seemed to be ok, so I figured it was some kind of combination.

    Seems strange it would happen since I was just using wordpress and everythign else default... I didn't want to spend all the time being scientific about it since I don't use those extensions on this machine.
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    3:40 PM
    Nginx 1.13.x
    MariaDB 5.5
    k no worries.. strange though but not unexpected if php 5.5 is old enough to not be compatible with some of php extensions. PHP 5.6 should be safer for such
     
  8. ethanpil

    ethanpil Active Member

    168
    47
    28
    Nov 8, 2015
    Ratings:
    +87
    Local Time:
    3:40 PM
    Maybe default PHP for .09 should be 5.6?
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    3:40 PM
    Nginx 1.13.x
    MariaDB 5.5
    you can actually select different betainstallers with different default php versions for 5.6 and 7 Beta Branch - Centmin Mod .09 beta branch Testing | Centmin Mod Community
     
    • Informative Informative x 1
  10. ethanpil

    ethanpil Active Member

    168
    47
    28
    Nov 8, 2015
    Ratings:
    +87
    Local Time:
    3:40 PM
    Didnt know. Thanks!