Edit report at http://bugs.php.net/bug.php?id=40286&edit=1
ID: 40286 Comment by: jason at backup-technology dot co dot uk Reported by: gabriel at oxeva dot fr Summary: PHP fastcgi with PHP_FCGI_CHILDREN don't kill children when parent is killed Status: No Feedback Type: Bug Package: CGI related Operating System: Linux 2.6 PHP Version: 5.2.0+ Assigned To: dmitry Block user comment: N New Comment: We're experiencing this issue with 5.2.14 and also 5.3.3. On 5.2.14 the strace of the hanging processes with parent ID 1 left behind show this: Process 21330 attached - interrupt to quit accept(0, It hangs on that and if we interrupt it shows: Process 21330 attached - interrupt to quit accept(0, <unfinished ...> Running a gdb (with debug symbols) and attaching to the process and running "bt" we get: (gdb) bt #0 0x000000320c8d4530 in __accept_nocancel () from /lib64/libc.so.6 #1 0x000000000062abe8 in fcgi_accept_request (req=0x7fff3cb385b0) at /usr/src/debug/php-5.2.14/sapi/cgi/fastcgi.c:957 #2 0x000000000062c14f in main (argc=1, argv=0x7fff3cb3a758) at /usr/src/debug/php-5.2.14/sapi/cgi/cgi_main.c:1703 On the 5.3.3 (with no debug symbols) we have the following: (gdb) bt #0 0x00000038936d4530 in __accept_nocancel () from /lib64/libc.so.6 #1 0x000000000063e0c3 in ?? () #2 0x000000000063ad2a in ?? () #3 0x000000389361d994 in __libc_start_main () from /lib64/libc.so.6 #4 0x0000000000421ec9 in _start () Hope this helps. Jason. Previous Comments: ------------------------------------------------------------------------ [2009-07-26 21:55:21] machochito at gmail dot com I have the same problem on CentOS 5.3 with php 5.2.9. Have someone solution to this problem? Thanks. ------------------------------------------------------------------------ [2009-07-22 20:45:21] bgross at mcw dot edu ... on second thought, after looking at my php.ini again, I think the major change was due to adding the line "session.gc_probability = 1". I believe this is set to "session.gc_probability = 0" by default in Debian ------------------------------------------------------------------------ [2009-07-22 20:14:41] bgross at mcw dot edu I'm not familiar with the inner-workings PHP, so I'm sorry if this is not relevant. I was experiencing a problem with php-cgi processes staying around and filling up my memory. After I added the line "cgi.fix_pathinfo=1" to my php.ini, the problem went away. I'm using PHP FastCGI 5.2.6 with Lighttpd 1.4.19 on Debian 5.0.2 Hope that's helpful ------------------------------------------------------------------------ [2009-07-02 03:41:27] porjo38 at yahoo dot com dot au The php 5.3.0 changelog states the following: "Fixed bug #40286 (PHP fastcgi with PHP_FCGI_CHILDREN don't kill children when parent is killed). (Dmitry)" I've just compiled php 5.3.0 under Centos5.3 with Apache2.2.3 + mod_fcgid2.2-4. The issue is still occuring for me. When I restart Apache, I usually end up with a bunch of php-cgi process with ppid of 1 (init), although it doesn't happen every time. ------------------------------------------------------------------------ [2009-05-16 03:43:15] scripts at topducks dot com I'm using php5.2.9 mod_fcgid, not using children method. Whenever I restart apache I get orphaned php processes. Without the cron job to check and kill them off they would waste a lot of memory. ------------------------------------------------------------------------ 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 http://bugs.php.net/bug.php?id=40286 -- Edit this bug report at http://bugs.php.net/bug.php?id=40286&edit=1