2

Under load, my PHP5-fpm (on 32bit ubuntu 10.10) produces segfaults like the following:

kernel: [4881937.884863] php5-fpm[2638]: segfault at 4204eb41 ip 0832d235 sp bfcea5e0 error 4 in php5-fpm[8048000+70d000]

How do I make it so these segfaults produce a core dump so that I can inspect the call stack to figure out where the segfault is coming from?

Where do the core dumps go once they are produced?

mgorven
  • 30,615
  • 7
  • 79
  • 122
rynop
  • 239
  • 4
  • 16

1 Answers1

12

You can enable core dump with:

su -
echo '/tmp/core-%e.%p' > /proc/sys/kernel/core_pattern
echo 0 > /proc/sys/kernel/core_uses_pid
ulimit -c unlimited

Set the rlimit_core directive in /etc/php-fpm.d/www.conf to unlimited:

rlimit_core = unlimited
quanta
  • 51,413
  • 19
  • 159
  • 217