Debian Bug report logs - #431799
php5-cgi: PHP fastcgi with PHP_FCGI_CHILDREN doesn't kill children when parent is killed

version graph

Package: php5-cgi; Maintainer for php5-cgi is Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>; Source for php5-cgi is src:php5.

Reported by: Raphael Geissert <atomo64@gmail.com>

Date: Wed, 4 Jul 2007 23:33:02 UTC

Severity: important

Found in versions php5/5.2.0-8+etch4, php5/5.2.4-2

Done: Ondřej Surý <ondrej@sury.org>

Bug is archived. No further changes may be made.

Forwarded to http://bugs.php.net/bug.php?id=40286

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#431799; Package php5-cgi. Full text and rfc822 format available.

Acknowledgement sent to Raphael Geissert <atomo64@gmail.com>:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Raphael Geissert <atomo64@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: php5-cgi: PHP fastcgi with PHP_FCGI_CHILDREN doesn't kill children when parent is killed
Date: Wed, 04 Jul 2007 18:31:46 -0500
Package: php5-cgi
Version: 5.2.0-8+etch4
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoting from: http://bugs.php.net/bug.php?id=40286 
- --
Context:
When running PHP in FastCGI mode with a fastCGI apache module (such a
mod_fcgid), all is running fine when PHP_FCGI_CHILDREN unset : only 1
process spawned. When using PHP_FCGI_CHILDREN=n, the PHP parent process
forks n childs, and the parent acts as a manager between the child
processes, wait()ing to respawn them if they are killed or exit. The
problem happens when the FastCGI process manager handled by the apache
module has to kill the parent PHP process (it only knows the parent's
PID) for any reason such as idle timeout, max lifetime, etc.

Problem:
While the PHP parent process is properly killed by the FastCGI process
manager, the children aren't killed, but instead stay alive, waiting for
a new request which will never come (because the socket shared with the
parent is removed at the same time parent is killed).
- --

At the end of the PHP bug report there's a patch.
PHP4 Is also affected (and I guess, but can't confirm, lenny's PHP4/5 are also affected).

This bug causes a lot useless php[4|5]-cgi processes to remain on memory and thus consuming resources.
I hope a fixed php[4|5]-cgi package can make into etch's r1 or even before (if possible).


- -- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (100, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-1-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGjC3iYy49rUbZzloRAmUBAJ9wrP8K1x1PwjysFsFTAhLTIvnHRQCfQPAd
YnRVnKzAjwVS3Kb+Su8NfLg=
=s/V3
-----END PGP SIGNATURE-----



Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#431799; Package php5-cgi. Full text and rfc822 format available.

Acknowledgement sent to Raphael <atomo64@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #10 received at 431799@bugs.debian.org (full text, mbox):

From: Raphael <atomo64@gmail.com>
To: 431799@bugs.debian.org
Subject: Progress
Date: Tue, 21 Aug 2007 20:10:22 -0500
I was wondering if this bug is going to be considered for the next
Debian Etch revision, since r1 is already out.

This bug causes a very high resources usage so I think it should be fixed ASAP.

-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Say NO to Microsoft Office broken standard.
See http://www.noooxml.org/petition



Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#431799; Package php5-cgi. Full text and rfc822 format available.

Acknowledgement sent to Ondřej Surý <ondrej@sury.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #15 received at 431799@bugs.debian.org (full text, mbox):

From: Ondřej Surý <ondrej@sury.org>
To: Raphael Geissert <atomo64@gmail.com>, 431799@bugs.debian.org
Subject: Re: [php-maint] Bug#431799: php5-cgi: PHP fastcgi with PHP_FCGI_CHILDREN doesn't kill children when parent is killed
Date: Wed, 22 Aug 2007 09:10:11 +0200
Raphael Geissert píše v St 04. 07. 2007 v 18:31 -0500:
> At the end of the PHP bug report there's a patch.

I don't believe that attached patch fixes that particular problem.
It only eliminates one extra pointer to memory, which is only cosmetics
change to code and not any change in functionality.

Correct fix would be to use non-blocking IO.  Or use select(2) on that
descriptor to not block when no data is available.

But of course I could be wrong and this is The Right Fix(tm).

Ondrej
-- 
Ondřej Surý <ondrej@sury.org>  ***  http://blog.rfc1925.org/
Kulturní občasník              ***  http://www.obcasnik.cz/
Nehoupat, prosím               ***  http://nehoupat.blogspot.com/





Bug marked as found in version 5.2.4-2. Request was from Raphael Geissert <atomo64@gmail.com> to control@bugs.debian.org. (Tue, 26 Aug 2008 22:39:03 GMT) Full text and rfc822 format available.

Noted your statement that Bug has been forwarded to http://bugs.php.net/bug.php?id=40286. Request was from Raphael Geissert <atomo64@gmail.com> to control@bugs.debian.org. (Sat, 04 Oct 2008 19:48:13 GMT) Full text and rfc822 format available.

Bug no longer marked as found in version 5.2.4-2. Request was from Sean Finney <seanius@debian.org> to control@bugs.debian.org. (Tue, 24 Mar 2009 09:12:12 GMT) Full text and rfc822 format available.

Bug marked as found in version 5.2.4-2. Request was from Sean Finney <seanius@debian.org> to control@bugs.debian.org. (Tue, 24 Mar 2009 09:12:17 GMT) Full text and rfc822 format available.

Tags removed: patch Request was from Raphael Geissert <atomo64@gmail.com> to control@bugs.debian.org. (Fri, 15 May 2009 17:03:03 GMT) Full text and rfc822 format available.

Reply sent to Ondřej Surý <ondrej@sury.org>:
You have taken responsibility. (Sun, 10 Apr 2011 22:15:27 GMT) Full text and rfc822 format available.

Notification sent to Raphael Geissert <atomo64@gmail.com>:
Bug acknowledged by developer. (Sun, 10 Apr 2011 22:15:31 GMT) Full text and rfc822 format available.

Message #30 received at 431799-done@bugs.debian.org (full text, mbox):

From: Ondřej Surý <ondrej@sury.org>
To: 431799-done@bugs.debian.org, Raphael Geissert <geissert@debian.org>
Subject: Re: [php-maint] Bug#431799: Bug#431799: php5-cgi: PHP fastcgi with PHP_FCGI_CHILDREN doesn't kill children when parent is killed
Date: Mon, 11 Apr 2011 00:10:34 +0200
Raphael,

this is your bug...  I am closing it now, since it's been reported
against some ancient version of PHP. Feel free to reopen it if you
feel like fixing it :).

O.

2007/8/22 Ondřej Surý <ondrej@sury.org>:
> Raphael Geissert píše v St 04. 07. 2007 v 18:31 -0500:
>> At the end of the PHP bug report there's a patch.
>
> I don't believe that attached patch fixes that particular problem.
> It only eliminates one extra pointer to memory, which is only cosmetics
> change to code and not any change in functionality.
>
> Correct fix would be to use non-blocking IO.  Or use select(2) on that
> descriptor to not block when no data is available.
>
> But of course I could be wrong and this is The Right Fix(tm).
>
> Ondrej
> --
> Ondřej Surý <ondrej@sury.org>  ***  http://blog.rfc1925.org/
> Kulturní občasník              ***  http://www.obcasnik.cz/
> Nehoupat, prosím               ***  http://nehoupat.blogspot.com/
>
>
>
>
> _______________________________________________
> pkg-php-maint mailing list
> pkg-php-maint@lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-php-maint



-- 
Ondřej Surý <ondrej@sury.org>




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 09 May 2011 07:52:20 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 15:34:48 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.