I have questions about segmentation faults.

I am runnbing Debian + Nging + Php5-fpm + Mysql + Imagemagick.

  1. How to find out what script (or program) is causing segmentation faults? I need a very simple step-by-step instruction. I searched Google and all available insructions are for professionals - "if you have a core file do this.., "connect debugger" etc.

  2. In my case segmentation faults are not regular. Sometimes I have 10 segfaults just in 1 day but sometimes I don't have any for months. I don't have any scripts that run only sometimes. If it's a script problem, I must have hundreds of segfaults every day. So, why segfaults are only occurring sometimes?

  3. What are the most frequent cases of segfaults?


[28-May-2013 21:33:51] WARNING: [pool www] child 19448 exited on signal 11 (SIGSEGV) after 3514.206284 seconds from start
[28-May-2013 21:33:56] WARNING: [pool www] child 20302 exited on signal 11 (SIGSEGV) after 4.462827 seconds from start
[07-Jun-2013 20:57:40] WARNING: [pool www] child 2685 exited on signal 11 (SIGSEGV) after 58927.043729 seconds from start
[07-Jun-2013 20:58:37] WARNING: [pool www] child 2684 exited on signal 11 (SIGSEGV) after 58987.506016 seconds from start
[10-Jun-2013 01:23:01] WARNING: [pool www] child 14603 exited on signal 11 (SIGSEGV) after 51802.304617 seconds from start
[10-Jun-2013 01:23:58] WARNING: [pool www] child 9218 exited on signal 11 (SIGSEGV) after 74891.918340 seconds from start
[24-Jun-2013 00:04:39] WARNING: [pool www] child 22121 exited on signal 11 (SIGSEGV) after 156563.946260 seconds from start
[24-Jun-2013 00:06:01] WARNING: [pool www] child 25055 exited on signal 11 (SIGSEGV) after 81.358472 seconds from start
[24-Jun-2013 00:07:10] WARNING: [pool www] child 20595 exited on signal 11 (SIGSEGV) after 165026.445021 seconds from start
[24-Jun-2013 00:07:55] WARNING: [pool www] child 22122 exited on signal 11 (SIGSEGV) after 156754.694714 seconds from start
[13-Jul-2013 15:59:31] WARNING: [pool www] child 24307 exited on signal 11 (SIGSEGV) after 2526.197996 seconds from start
[13-Jul-2013 15:59:42] WARNING: [pool www] child 24318 exited on signal 11 (SIGSEGV) after 2528.783217 seconds from start
[13-Jul-2013 16:02:29] WARNING: [pool www] child 24389 exited on signal 11 (SIGSEGV) after 2260.254718 seconds from start
[13-Jul-2013 16:19:51] WARNING: [pool www] child 25119 exited on signal 11 (SIGSEGV) after 1209.036619 seconds from start
[15-Jul-2013 01:22:29] WARNING: [pool www] child 20613 exited on signal 11 (SIGSEGV) after 3060.402119 seconds from start
  • You say: "I searched Google and all available insructions are for professionals". This site is also for professionals, working on system administration. Try Stack Overflow for help with debugging your code. Jul 16, 2013 at 22:06
  • A segfault is the result of a program bug, usually. The information you've provided here would be of no use to anyone trying to see what is going on; pattern analysis is not useful in this case and a segfault indicates one of a very large field of potential problems. Jul 17, 2013 at 1:34
  • 1
    As @Avibodha said below, one possibility has nothing to do with 'program bugs', but it might be a result of a buggy PHP extension. Indeed, opcode caches, memcache/d — or, in my case, the New Relic extension — are all known to occasionally segfault php_fpm. Unlike more typical 'bugs', where they are easily reproductible, a bad/buggy extension might just occasionally segfault (i.e. when a limit is reached). This also means absolutely no PHP errors, neither on display, nor on logs. The solution in this case is really to enable/disable extensions until the faulty one is found. Jun 5, 2016 at 23:01

1 Answer 1

  1. I don't think I'd start with core dumps since you're not comfortable with the tools. First, since it's the child segfaulting, check for php errors. Fix any php errors. Post any php errors you can't figure out.

  2. often segfaults are memory related and memory is changing all the time, especially as server load changes.

  3. memory problems, stack problems. misconfiguration of anything in php stack. php errors that lead to bigger problems after they occur.

Are you running the latest Imagemagick?

Are you running an opcode cache (apc etc)? if so, try turning off and see if errors disappear.

If none of those work, you'll have to set up Xdebug and debug the app.

Not the answer you're looking for? Browse other questions tagged or ask your own question.