www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Lauer <rla...@cji.com>
Subject general/6314: parent waits indefinetly for a forked child
Date Fri, 14 Jul 2000 15:02:25 GMT

>Number:         6314
>Category:       general
>Synopsis:       parent waits indefinetly for a forked child
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Jul 14 08:10:02 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     rlauer@cji.com
>Release:        
>Organization:
apache
>Environment:
solaris 5.6
>Description:
A CGI writes to stdout (perhaps a short HTML segment) closes stdout and forks a child.  The
parent then exits.  The child goes off and continues processing.  Apparently, Apache is waiting
for the child to exit before any output is actually sent to the browser.

Looks like apache is holding the socket open to the browser, despite the fact that both parent
and child have closed STDOUT.  Only when the child exits does the connection get released.
>How-To-Repeat:
#!/usr/bin/perl

$| = 1;

print "Content-type: text/html\n\n<html><body><h1>test</h1></body></html>\n";
close STDOUT;
my $pid = fork();
if ($pid > 0) {
  exit(0);
}
else {
  close STDOUT;
  sleep(60);
  exit(0);
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]
 
 


Mime
View raw message