From nobody@FreeBSD.org  Wed Sep 21 17:58:08 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9F74316A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Sep 2005 17:58:08 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6F09843D45
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Sep 2005 17:58:08 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j8LHw7MC019531
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 21 Sep 2005 17:58:07 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j8LHw6go019441;
	Wed, 21 Sep 2005 17:58:06 GMT
	(envelope-from nobody)
Message-Id: <200509211758.j8LHw6go019441@www.freebsd.org>
Date: Wed, 21 Sep 2005 17:58:06 GMT
From: Max Belushkin <m.belushkin@fz-juelich.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Apache-2.0.54_4 PHP popen hangs
X-Send-Pr-Version: www-2.3

>Number:         86421
>Category:       ports
>Synopsis:       www/Apache20 2.0.54_4 PHP popen hangs
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    clement
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 21 18:00:29 GMT 2005
>Closed-Date:    Wed Jul 16 14:37:45 UTC 2008
>Last-Modified:  Wed Jul 16 14:37:45 UTC 2008
>Originator:     Max Belushkin
>Release:        FreeBSD 5.1
>Organization:
University of Bonn
>Environment:
FreeBSD localhost 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Thu Jun  5 02:55:42 GMT 2003     root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
After the upgrade to apache 2.0.54_4, the following simple PHP script freezes the apache thread: $handle=popen("/bin/cat", "w");. This only occurs on programs which request stdin input - i.e. $handle=popen("/bin/ls", "w") will not produce the above problem. Naturally, this freezes the "mail" function of PHP.
I have did portupgrade -fRr on apache2, I have done portupgrade -fPP on apache2, the problem persists in all cases.
The problem does not exist in the command-line PHP interpreter.
ps ax will report sh -c cat and cat in the process list. httpd will not fully exit until those are killed - it still takes up the port.
>How-To-Repeat:
On apache-2.0.54_4 with php4 as module:
<?php $handle=fopen("/bin/cat", "w");?>, save as, i.e., test.php, and try opening it with your browser.
The command-line php interpreter (php test.php) will work on it fine, but not the apache module.
>Fix:
      
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-www->clement 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Sep 21 18:40:31 GMT 2005 
Responsible-Changed-Why:  
Over to clement to see if he can determine whether this is an apache2 or 
php problem. 

Note to submitter: the correct GNATS category for this is 'ports', not 
www; www is used for the FreeBSD website itself. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86421 

From: Maxim A Belushkin <m.belushkin@fz-juelich.de>
To: bug-followup@FreeBSD.org, m.belushkin@fz-juelich.de
Cc:  
Subject: Re: ports/86421: Apache-2.0.54_4 PHP popen hangs
Date: Wed, 21 Sep 2005 21:20:59 +0200

 proc_open is not affected by this bug.
 
State-Changed-From-To: open->feedback 
State-Changed-By: clement 
State-Changed-When: Thu Dec 1 19:05:16 GMT 2005 
State-Changed-Why:  
Does the problem persist with recent apache2 and php updates? 


http://www.freebsd.org/cgi/query-pr.cgi?pr=86421 

From: Max Belushkin <m.belushkin@fz-juelich.de>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/86421: Apache-2.0.54_4 PHP popen hangs
Date: Thu, 15 Dec 2005 17:48:24 +0100

 Yes, this problem still persists with apache-2.0.55_2 and php-4.4.1_3
State-Changed-From-To: feedback->open 
State-Changed-By: erwin 
State-Changed-When: Fri Dec 29 18:46:26 UTC 2006 
State-Changed-Why:  
Feedback received. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86421 

From: "Philip M. Gollucci" <pgollucci@ridecharge.com>
To: bug-followup@FreeBSD.org, m.belushkin@fz-juelich.de
Cc:  
Subject: Re: ports/86421: www/Apache20 2.0.54_4 PHP popen hangs
Date: Wed, 14 May 2008 18:15:53 -0400

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 is this still an issue with 2.0.63 or 2.2.8 and php5 ?
 
 
 - --
 - ------------------------------------------------------------------------
 Philip M. Gollucci (philip@ridecharge.com)
 o:703.549.2050x206
 Senior System Admin - Riderway, Inc.
 http://riderway.com / http://ridecharge.com
 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C
 
 Work like you don't need the money,
 love like you'll never get hurt,
 and dance like nobody's watching.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.8 (FreeBSD)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFIK2SZdbiP+9ubjBwRAo2/AKCR08QRdGO9KmZMHbNRRXJCQaetbgCfRYqs
 jNS6teUJbskXZXIQybaBIPU=
 =+X85
 -----END PGP SIGNATURE-----

From: Pav Lucistnik <pav@FreeBSD.org>
To: bug-followup@FreeBSD.org, m.belushkin@fz-juelich.de
Cc:  
Subject: Re: ports/86421: www/Apache20 2.0.54_4 PHP popen hangs
Date: Thu, 15 May 2008 00:42:30 +0200

 This looks like a feature to me. pclose() will not terminate the
 executed binary, only close the pipe to it's input/output. You need to
 terminate the "cat" explicitly after pclose(). That how it's documented
 in the PHP manual.
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 Maybe I should go ask that elvish wizard standing over there (YES A REAL
 ELF IS STANDING IN MY ROOM!), he should be able to tell me.
 
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Wed Jul 16 14:36:04 UTC 2008 
State-Changed-Why:  
Not a bug, also no activity for 3 months  

http://www.freebsd.org/cgi/query-pr.cgi?pr=86421 
>Unformatted:
