php-fpm child process exited on signal 11
When you see a php-fpm child process terminated by signal 11 (SIGSEGV), itâs a segmentation fault, not a graceful shutdown or an OOM killer. The core dump and backtrace tell the story: the crash happens inside libmemcached.so.10, specifically in memcached_io_readline. This is not a PHP language issue; itâs a native extension failure triggered by how the process accesses memory while talking to memcached.
The environment describedâUbuntu 14.04, Nginx 1.4.6, Memcached 1.4.14, and PHP 5.5.9 with pm.max_children = 30âshows a setup thatâs already under pressure. System memory is 7.5 GB, memcached claims 2 GB, and the remaining ~5.5 GB has to feed both the OS, Nginx workers, and up to 30 PHP-FPM children at once. Under load, free memory can dip low enough that either memcached or PHP starts accessing stale or unmapped pages, which leads exactly to the kind of SIGSEGV seen here.
The backtrace points to memcached_io_readline, a function responsible for reading data from the memcached server socket. The crash address (0x7f41ccaea13a) is inside libmemcached.so.10, not in PHP core. That means the issue is almost certainly a bug in the libmemcached library or its interaction with the underlying OS when memory pressure is high. On older Ubuntu releases like 14.04, both PHP and memcached packages are often tied to ancient glibc versions and may lack fixes for edge cases that modern distributions handle more robustly.
A few practical steps can help you stabilize this setup:
- Upgrade the stack. Staying on PHP 5.5 and Ubuntu 14.04 is a significant part of the problem. Moving to a supported LTS (e.g., Ubuntu 20.04 or 22.04) with PHP 7.x or 8.x and a newer memcached client library eliminates many known bugs in
libmemcached. - Tune memcached memory. If you must stay on the current stack, reduce memcachedâs reserved memory or increase it slightly to avoid starving PHP of buffers during spikes. Monitor actual usage with
slab -aandstats itemsrather than relying solely on a static 2 GB limit. - Limit PHP-FPM concurrency under load. Instead of hard-coding
pm.max_children = 30, use a more conservative dynamic policy or set a lower ceiling temporarily to see if crashes stop. For example:pm = dynamic pm.max_children = 20 pm.start_servers = 6 pm.min_spare_servers = 4 pm.max_spare_servers = 10 rlimit_files = 131072 rlimit_core = unlimited - Check for memory fragmentation. Run
free -h,vmstat 1, and inspect/proc/meminfoduring a crash window. Look atSlab_Cache_Objectsin memcached to see if large slabs are pinning memory and causing the OS to swap or drop pages unexpectedly. - Capture and analyze core dumps. The provided backtrace already shows the faulting function, but saving cores and running them under
gdbwith matching libraries can reveal whether the crash is due to a specific memcached command size, binary protocol edge case, or socket read buffer overflow.
If youâre moving to Laravel projects in production, the same pattern applies: avoid mixing very old system packages with modern application code. Consider using Docker Compose stacks that pin PHP, Nginx, and Memcached to LTS versions so you can apply upstream patches without fighting outdated glibc or libmemcached bugs. Resources like https://laravelcompany.com often highlight how modernizing the runtime environment reduces these kinds of crashes by default.
In short, signal 11 from libmemcached_io_readline is a symptom of an outdated client library running under memory stress. The most reliable fix is to upgrade the stack; if thatâs not immediately possible, constrain concurrency and carefully monitor memcached slabs to prevent the PHP process from ever hitting a memory-mapped region that has been freed or never allocated.