Php-fpm with so many segmentation fault

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version :12.0.0.3
Operating system and version:Openwrt(linux kernel runs on a router)
Apache or nginx version : nginx 1.10.2
PHP version :7.1.21

The issue you are facing:
There are so many segmentation faults in php-fpm’s log file which brings a poor user experience.Means,php-fpm worker process will encounter a SIGSEGV in the end.The shortest time it received a SIGSEGV is only 0.201147s from start.
Is this the first time you’ve seen this error? (Y/N):
no
Steps to replicate it:

  1. when the nextcloud server is overloaded(tell from the top cmd result of the idle percentage of CPU),there are so many nginx error log saying that “child xxx exited on signal 11 (SIGSEGV) after xxx seconds from start”

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => '*',
  ),
  'datadirectory' => '/mcloud/nextcloud-data',
  'overwrite.cli.url' => 'xxx',
  'dbtype' => 'mysql',
  'version' => '12.0.3.3',
  'dbname' => 'microcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'maintenance' => false,
  'filelocking.enable' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'default_language' => 'zh_CN',
  'force_language' => 'zh_CN',
);

The output of your Apache/nginx/system log in /var/log/____:

I'm using Nginx instead of Apache. So I paste an excerpt of nginx error log.There are too many logs like this.
2018/09/18 09:48:23 [error] 31183#0: *7168800 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: , request: "PROPFIND /remote.php/dav/files/hexian/%E6%B5%8B%E8%AF%95%E9%83%A8/%E6%B5%8B%E8%AF%95%E9%83%A8/%E4%BA%A7%E5%93%81%E8%A7%84%E6%A0%BC/%E8%A7%84%E6%A0%BC%E4%B9%A6%E6%96%B0%E6%A8%A1%E6%9D%BF%E5%B7%B2%E5%A4%84%E7%90%86/%E6%88%B7%E5%A4%96CPE/%E7%BA%BF%E4%B8%8B%E7%B3%BB%E5%88%97 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 09:53:58 [error] 31183#0: *7174983 recv() failed (104: Connection reset by peer) while reading upstream, client: 127.0.0.1, server: , request: "PROPFIND /remote.php/dav/files/mabin/%E7%A1%AC%E4%BB%B6%E4%BA%8B%E4%B8%9A%E9%83%A8/A55-H6/%E5%85%83%E4%BB%B6%E8%A7%84%E6%A0%BC%E4%B9%A6 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 09:54:16 [error] 31182#0: *7173317 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.3.2, server: , request: "PROPFIND /remote.php/dav/files/yangjunru/%E6%B5%8B%E8%AF%95%E9%83%A8/%E6%B5%8B%E8%AF%95%E6%8A%A5%E5%91%8A/SD-WAN/test/%E6%B5%8B%E8%AF%95%E9%83%A8-%E5%85%AC%E5%85%B1%E8%B5%84%E6%96%99/QCA9531%E5%87%BA%E5%8F%A3%E7%A8%B3%E5%AE%9A%E6%80%A7%E6%A3%80%E6%9F%A5/2016-9-13 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 09:57:50 [error] 31182#0: *7180865 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: , request: "PROPFIND /remote.php/dav/files/mabin/%E4%BA%A7%E5%93%81%E7%AE%A1%E7%90%86/%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D/%E4%B9%90%E5%85%89%E8%A7%84%E6%A0%BC%E4%B9%A6/%E6%97%A0%E7%BA%BF%E8%B7%AF%E7%94%B1 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 09:57:55 [error] 31182#0: *7180521 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.3.2, server: , request: "PROPFIND /remote.php/dav/files/yangjunru/%E6%B5%8B%E8%AF%95%E9%83%A8/%E6%B5%8B%E8%AF%95%E9%83%A8/%E4%BA%A7%E5%93%81%E8%A7%84%E6%A0%BC HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 09:59:10 [error] 31183#0: *7182578 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 119.123.198.72, server: , request: "PROPFIND /remote.php/dav/files/zhouxin/AutoCAD_2014_Simplified_Chinese_Win_64bit_dlm/x64/acad/Program%20Files/Root/Sample/VisualLISP HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:00:26 [error] 31182#0: *7184267 recv() failed (104: Connection reset by peer) while reading upstream, client: 192.168.3.2, server: , request: "PROPFIND /remote.php/dav/files/liuhaiyan/%E6%B5%8B%E8%AF%95%E9%83%A8/%E6%B5%8B%E8%AF%95%E9%83%A8/%E6%B5%8B%E8%AF%95%E6%8A%A5%E5%91%8A/SD-WAN/test/%E8%AE%BE%E5%A4%87%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E7%BB%93%E6%9E%9C%E6%96%87%E4%BB%B6/%E6%B5%8B%E8%AF%95%E7%9A%84%E5%8E%9F%E5%A7%8B%E6%95%B0%E6%8D%AE/20170913_%E8%80%81%E7%89%88%E6%9C%AC7621%E6%80%A7%E8%83%BD%E5%90%9E%E5%90%90/500%E6%B5%81 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:02:55 [error] 31183#0: *7189930 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: , request: "PROPFIND /remote.php/dav/files/tianjia/%E5%9B%BA%E4%BB%B6%E7%AE%A1%E7%90%86/%E7%BD%91%E5%85%B3/%E8%A1%8C%E4%B8%BA%E7%AE%A1%E7%90%86/AC3.3/9531_YL-%E6%97%A0%E7%BA%BF/20180521 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:04:35 [error] 31182#0: *7166697 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 61.144.172.68, server: , request: "PROPFIND /remote.php/dav/files/xiabinglei/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:04:44 [error] 31183#0: *7192995 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: , request: "PROPFIND /remote.php/dav/files/tianjia/%E5%9B%BA%E4%BB%B6%E7%AE%A1%E7%90%86/%E4%B9%9D%E9%93%BE%E5%9B%BA%E4%BB%B6/%E5%B0%8F%E5%9F%8E%E5%B0%8F%E4%BA%8B/%E6%AD%A3%E5%BC%8F%E8%BD%AC%E6%B5%8B%E8%AF%95/vvtrip-201805182024 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:06:24 [error] 31183#0: *7195320 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.3.2, server: , request: "PROPFIND /remote.php/dav/files/yangjunru/%E6%B5%8B%E8%AF%95%E9%83%A8/%E6%B5%8B%E8%AF%95%E9%83%A8/%E6%B5%8B%E8%AF%95%E6%8A%A5%E5%91%8A/SD-WAN/test/%E6%B5%8B%E8%AF%95%E9%83%A8-%E5%85%AC%E5%85%B1%E8%B5%84%E6%96%99/QCA9531%E5%87%BA%E5%8F%A3%E7%A8%B3%E5%AE%9A%E6%80%A7%E6%A3%80%E6%9F%A5/2016-9-14/%E4%B8%8B%E5%8D%8818%EF%BC%9A00 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:07:56 [error] 31183#0: *7198491 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: , request: "PROPFIND /remote.php/dav/files/tianjia/%E5%9B%BA%E4%BB%B6%E7%AE%A1%E7%90%86/%E7%BD%91%E5%85%B3/%E8%A1%8C%E4%B8%BA%E7%AE%A1%E7%90%86/AC4.0/AC9563-9886-webdav/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86/2018%E5%AE%9A%E5%88%B6%E9%A1%B9%E7%9B%AE/%E8%BD%AF%E7%A1%AC%E4%BB%B6ODM%E5%AE%9A%E5%88%B6/20180813-%E7%AE%80%E8%8A%AF-ITMS%E7%94%B5%E5%8A%9B%E7%8C%AB/%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3%E7%9B%B8%E5%85%B3/Elink/E-LINK%20SDK/vendors HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:13:26 [error] 31183#0: *7206639 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.3.2, server: , request: "PROPFIND /remote.php/dav/files/echo/%E5%90%AF%E4%BB%91%E6%99%BA%E8%83%BD/%E8%AF%B4%E6%98%8E%E4%B9%A6/%E7%BD%91%E6%A1%A5/N595%E7%BD%91%E6%A1%A5 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:18:06 [error] 31182#0: *7214792 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: , request: "PROPFIND /remote.php/dav/files/tianjia/%E6%B5%8B%E8%AF%95%E9%83%A8/%E6%B5%8B%E8%AF%95%E6%8A%A5%E5%91%8A/SD-WAN/test/%E6%B5%8B%E8%AF%95%E9%83%A8-%E5%85%AC%E5%85%B1%E8%B5%84%E6%96%99/%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE/%E5%90%84%E7%A7%8D%E5%AE%A2%E6%88%B7%E6%9C%BA%E7%BB%88%E7%AB%AF%E6%B5%8F%E8%A7%88%E5%99%A8%E6%8A%93%E5%8C%85 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:18:25 [error] 31182#0: *7214805 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 119.123.198.72, server: , request: "PROPFIND /remote.php/dav/files/zhouxin/%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86/%E5%85%B6%E4%BB%96%E5%A4%87%E4%BB%BD/%E6%99%BA%E8%83%BD%E5%AE%B6%E5%B1%85LR100/APP/%E4%BB%A3%E7%A0%81%E5%8C%85/20180111 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:31:24 [error] 31183#0: *7216797 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 119.123.198.72, server: , request: "PROPFIND /remote.php/dav/files/zhouxin/%E5%9B%BA%E4%BB%B6%E7%AE%A1%E7%90%86/%E4%B9%9D%E9%93%BE%E5%9B%BA%E4%BB%B6/%E8%B4%A7%E5%85%9C HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"
2018/09/18 10:37:27 [error] 31183#0: *7215589 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 61.144.172.68, server: , request: "PROPFIND /remote.php/dav/files/wanglihuai/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock:", host: "xxx"

For every nginx error log,there is a corresponding “dmesg -T” log and php-fpm.error.log
Contents below comes from “dmesg -T”
[Tue Sep 18 09:48:23 2018] traps: php-fpm[12169] general protection ip:570c2e sp:7ffd6d591050 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 09:53:58 2018] traps: php-fpm[11762] general protection ip:570c6f sp:7ffd6d591050 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 09:54:16 2018] traps: php-fpm[11909] general protection ip:7f334a4cfb66 sp:7ffd6d58e8d0 error:0 in json.so[7f334a4cc000+206000]
[Tue Sep 18 09:57:50 2018] php-fpm[13919]: segfault at 0 ip 00000000005ef0ea sp 00007ffd6d58ff20 error 4 in php-fpm[400000+35d000]
[Tue Sep 18 09:57:55 2018] traps: php-fpm[5159] general protection ip:7f334a4cfb66 sp:7ffd6d58e8d0 error:0 in json.so[7f334a4cc000+206000]
[Tue Sep 18 09:59:10 2018] traps: php-fpm[14210] general protection ip:5a8f83 sp:7ffd6d58f930 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:00:26 2018] traps: php-fpm[9397] general protection ip:570c6f sp:7ffd6d591050 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:02:55 2018] traps: php-fpm[11569] trap stack segment ip:5ec3cc sp:7ffd6d58ff10 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:04:35 2018] traps: php-fpm[9519] general protection ip:570c2e sp:7ffd6d591050 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:04:44 2018] traps: php-fpm[9248] general protection ip:58e804 sp:7ffd6d58fc00 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:06:24 2018] php-fpm[9247]: segfault at 16 ip 0000000000440f95 sp 00007ffd6d58efe0 error 4 in php-fpm[400000+35d000]
[Tue Sep 18 10:07:56 2018] traps: php-fpm[9381] general protection ip:570c6f sp:7ffd6d5910a0 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:13:26 2018] traps: php-fpm[8489] general protection ip:570c6f sp:7ffd6d591050 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:18:06 2018] traps: php-fpm[8987] general protection ip:7f334a4cfb66 sp:7ffd6d58e8d0 error:0 in json.so[7f334a4cc000+206000]
[Tue Sep 18 10:18:25 2018] traps: php-fpm[9446] general protection ip:5a9ad6 sp:7ffd6d58f9a0 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:31:24 2018] traps: php-fpm[9577] general protection ip:570c6f sp:7ffd6d591050 error:0 in php-fpm[400000+35d000]
[Tue Sep 18 10:37:27 2018] traps: php-fpm[10373] general protection ip:5a9ae5 sp:7ffd6d58f9a0 error:0 in php-fpm[400000+35d000]

Content below comes from PHP’s log file:php-fpm.log
[18-Sep-2018 09:48:23] WARNING: [pool www] child 12169 exited on signal 11 (SIGSEGV) after 48955.205001 seconds from start
[18-Sep-2018 09:48:23] NOTICE: [pool www] child 9068 started
[18-Sep-2018 09:53:58] WARNING: [pool www] child 11762 exited on signal 11 (SIGSEGV) after 50035.676526 seconds from start
[18-Sep-2018 09:53:58] NOTICE: [pool www] child 9247 started
[18-Sep-2018 09:54:16] WARNING: [pool www] child 11909 exited on signal 11 (SIGSEGV) after 49756.015690 seconds from start
[18-Sep-2018 09:54:16] NOTICE: [pool www] child 9248 started
[18-Sep-2018 09:57:50] WARNING: [pool www] child 13919 exited on signal 11 (SIGSEGV) after 46749.411918 seconds from start
[18-Sep-2018 09:57:50] NOTICE: [pool www] child 9380 started
[18-Sep-2018 09:57:55] WARNING: [pool www] child 5159 exited on signal 11 (SIGSEGV) after 6703.077746 seconds from start
[18-Sep-2018 09:57:55] NOTICE: [pool www] child 9381 started
[18-Sep-2018 09:59:10] WARNING: [pool www] child 14210 exited on signal 11 (SIGSEGV) after 46289.844364 seconds from start
[18-Sep-2018 09:59:10] NOTICE: [pool www] child 9397 started
[18-Sep-2018 10:00:26] WARNING: [pool www] child 9397 exited on signal 11 (SIGSEGV) after 75.517471 seconds from start
[18-Sep-2018 10:00:26] NOTICE: [pool www] child 9446 started
[18-Sep-2018 10:02:55] WARNING: [pool www] child 11569 exited on signal 7 (SIGBUS) after 50907.491859 seconds from start
[18-Sep-2018 10:02:55] NOTICE: [pool www] child 9519 started
[18-Sep-2018 10:04:35] WARNING: [pool www] child 9519 exited on signal 11 (SIGSEGV) after 100.053306 seconds from start
[18-Sep-2018 10:04:35] NOTICE: [pool www] child 9577 started
[18-Sep-2018 10:04:44] WARNING: [pool www] child 9248 exited on signal 11 (SIGSEGV) after 627.696198 seconds from start
[18-Sep-2018 10:04:44] NOTICE: [pool www] child 9581 started
[18-Sep-2018 10:06:24] WARNING: [pool www] child 9247 exited on signal 11 (SIGSEGV) after 745.919638 seconds from start
[18-Sep-2018 10:06:24] NOTICE: [pool www] child 9633 started
[18-Sep-2018 10:07:56] WARNING: [pool www] child 9381 exited on signal 11 (SIGSEGV) after 600.845470 seconds from start
[18-Sep-2018 10:07:56] NOTICE: [pool www] child 9704 started
[18-Sep-2018 10:13:26] WARNING: [pool www] child 8489 exited on signal 11 (SIGSEGV) after 2593.137103 seconds from start
[18-Sep-2018 10:13:26] NOTICE: [pool www] child 10078 started
[18-Sep-2018 10:18:06] WARNING: [pool www] child 8987 exited on signal 11 (SIGSEGV) after 1932.144500 seconds from start
[18-Sep-2018 10:18:06] NOTICE: [pool www] child 10371 started
[18-Sep-2018 10:18:25] WARNING: [pool www] child 9446 exited on signal 11 (SIGSEGV) after 1079.231464 seconds from start
[18-Sep-2018 10:18:25] NOTICE: [pool www] child 10373 started
[18-Sep-2018 10:31:24] WARNING: [pool www] child 9577 exited on signal 11 (SIGSEGV) after 1608.707564 seconds from start
[18-Sep-2018 10:31:24] NOTICE: [pool www] child 10751 started
[18-Sep-2018 10:37:27] WARNING: [pool www] child 10373 exited on signal 11 (SIGSEGV) after 1141.617899 seconds from start
[18-Sep-2018 10:37:27] NOTICE: [pool www] child 10972 started

When the system is idle, php-fpm works fine.But when the system is overloaded, php-fpm will exited on SIGSEGV in the end.
Has anyone encounted the same problem like this?Really confused,hope somebody could help.Thanks in advance^_^