Edit report at https://bugs.php.net/bug.php?id=62954&edit=1
ID: 62954 Updated by: tony2...@php.net Reported by: jonas at brachium-system dot net Summary: startup problems fpm / php-fpm Status: Feedback Type: Bug Package: FPM related Operating System: Linux PHP Version: 5.3Git-2012-08-27 (Git) Assigned To: fat Block user comment: N Private report: N New Comment: #4 0xb42fcd66 in pcrecpp::RE::Cleanup() () from /usr/lib/libpcrecpp.so.0 #5 0xb42fce02 in pcrecpp::RE::~RE() () from /usr/lib/libpcrecpp.so.0 This looks like a problem of your system's PCRE library. No idea why would you use it instead of the bundled, but can you just try a plain PHP version provided from php.net and see if you still can reproduce the problem? Preferably a recent snapshot, preferable without any external libs and opcode caches. This'll help us to understand if this is a genuine FPM problem or something different. Previous Comments: ------------------------------------------------------------------------ [2012-09-05 17:06:39] rainer-phpbugs at 7val dot com I can reproduce this problem with php 5.3.16 on SLES 11.2 x86_64 (after about 20 attempts on average), but not on Ubuntu 12.04.1 x86_64 or Centos (RHEL) 6.3 (no problem after more than 2000 restarts each). remove_usr1_usr2_fpm_unix.patch reliably fixes this problem for me. gdb backtraces of the hanging process always look like this (taken on opensuse 11 i386): #0 0xffffe424 in __kernel_vsyscall () #1 0xb4fe3e53 in __lll_lock_wait_private () from /lib/libc.so.6 #2 0xb4f762fb in _L_lock_10372 () from /lib/libc.so.6 #3 0xb4f74a66 in free () from /lib/libc.so.6 #4 0xb42fcd66 in pcrecpp::RE::Cleanup() () from /usr/lib/libpcrecpp.so.0 #5 0xb42fce02 in pcrecpp::RE::~RE() () from /usr/lib/libpcrecpp.so.0 #6 0xb4f3089f in __run_exit_handlers () from /lib/libc.so.6 #7 0xb4f308fd in exit () from /lib/libc.so.6 #8 0x084c382f in fpm_signals_sighandler_exit_ok (pid=10) at build/src/external/php-5.3.16/sapi/fpm/fpm/fpm_signals.c:254 #9 <signal handler called> #10 0xb4f70701 in _int_free () from /lib/libc.so.6 #11 0xb4f74a6d in free () from /lib/libc.so.6 #12 0x08426de0 in zend_hash_destroy (ht=0x891088c) at build/src/external/php-5.3.16/Zend/zend_hash.c:532 #13 0x08404762 in destroy_zend_class (pce=0x8911cb4) at build/src/external/php-5.3.16/Zend/zend_opcode.c:206 #14 0x08426dc8 in zend_hash_destroy (ht=0x87aa490) at build/src/external/php-5.3.16/Zend/zend_hash.c:529 #15 0x08414ed7 in zend_shutdown () at build/src/external/php-5.3.16/Zend/zend.c:762 #16 0x083a84da in php_module_shutdown () at build/src/external/php-5.3.16/main/main.c:2210 #17 0x084bf608 in fpm_php_cleanup (which=2, arg=0x0) at build/src/external/php-5.3.16/sapi/fpm/fpm/fpm_php.c:199 #18 0x084b5f0c in fpm_cleanups_run (type=2) at build/src/external/php-5.3.16/sapi/fpm/fpm/fpm_cleanup.c:45 #19 0x084c6c73 in fpm_unix_init_main () at build/src/external/php-5.3.16/sapi/fpm/fpm/fpm_unix.c:340 #20 0x084b4fe8 in fpm_init (argc=3, argv=0xbffb2fe4, config=0xbffb50a5 "conf/php-fpm.conf", prefix=0x0, pid=0x0, test_conf=0, run_as_root=0) at build/src/external/php-5.3.16/sapi/fpm/fpm/fpm.c:59 #21 0x084be0f5 in main (argc=3, argv=0xbffb2fe4) at build/src/external/php-5.3.16/sapi/fpm/fpm/fpm_main.c:1805 ------------------------------------------------------------------------ [2012-09-05 07:25:26] jonas at brachium-system dot net @David: Can you please explain, why an NGINX configuration option will solve that startup problem? ------------------------------------------------------------------------ [2012-09-02 19:47:46] david at appliedautonomics dot com Fixed on Debian Squeez via adding to fastcgi params: fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; ------------------------------------------------------------------------ [2012-09-02 16:43:24] per at techspot dot com This bug occurs more frequently on heavily loaded websites. On my testserver it is difficult to reproduce with a low load. But on my live server doing a "service php-fpm restart" makes it fail most times. For some reason the problem occurs less frequently in php-fpm 5.4.6 vs 5.3.16 opcode cachers also makes it occur more frequently, but it's possible to reproduce with no opcode cacher loaded aswell, same rules as above for frequency still apply (5.3 vs 5.4) Output from testserver below running CentOS v6.3 with all patches applied and php v5.4 via the remi repository: http://rpms.famillecollet.com/enterprise/6/test/x86_64/ # php -v PHP 5.4.6 (cli) (built: Aug 16 2012 14:26:39) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies with XCache v2.0.1, Copyright (c) 2005-2012, by mOo # DAEMON_COREFILE_LIMIT=unlimited strace -s1024 -f /etc/init.d/php-fpm restart 2>&1 | grep -i SEGV [pid 3017] rt_sigaction(SIGSEGV, {0x7fddd5050730, [SEGV], SA_RESTORER|SA_RESTART, 0x7fdddb55a920}, {SIG_DFL, [], 0}, 8) = 0 [pid 3017] rt_sigaction(SIGSEGV, {SIG_DFL, [SEGV], SA_RESTORER|SA_RESTART, 0x7fdddb55a920}, <unfinished ...> [pid 3017] <... rt_sigaction resumed> {0x7fddd5050730, [SEGV], SA_RESTORER|SA_RESTART, 0x7fdddb55a920}, 8) = 0 ------------------------------------------------------------------------ [2012-09-02 09:07:29] jonas at brachium-system dot net PHP 5.3.16-dev (fpm-fcgi) (built: Sep 2 2012 04:56:07) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies I have tried it with the current branch PHP-5.3. It started two times correctly (Starts and detaches) after the second start the problem occurs again. So problem is not fixed - I have not tried 5.4 since fpm sapi is the same. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=62954 -- Edit this bug report at https://bugs.php.net/bug.php?id=62954&edit=1