Received: (qmail 45969 invoked by uid 501); 3 Mar 2001 18:29:43 -0000 Message-Id: <20010303182943.45968.qmail@apache.org> Date: 3 Mar 2001 18:29:43 -0000 From: Rainer Weikusat Reply-To: weikusat@mail.uni-mainz.de To: submit@bugz.apache.org Subject: Apache being to trigger happy with respect to CGI programs X-Send-Pr-Version: 3.110 >Number: 7353 >Category: mod_cgi >Synopsis: Apache being to trigger happy with respect to CGI programs >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Sat Mar 03 10:30:00 PST 2001 >Closed-Date: Wed Mar 21 22:10:26 PST 2001 >Last-Modified: Wed Mar 21 22:10:26 PST 2001 >Originator: weikusat@mail.uni-mainz.de >Release: 1.3.4 >Organization: >Environment: Whatever >Description: If a CGI emits a Location:-header on stdout, apache apparently guesses that this particular program must have finished its work (at least without persistent connections) and will exit as soon as possible, thereby in turn terminating the program, which might or might not have had enough time to dissassociate itself (fork()/ setsid()) from the running httpd-instance. >How-To-Repeat: >Fix: - wait at least until std(in|out|err) are explicitly closed - document it >Release-Note: >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: slive State-Changed-When: Wed Mar 21 22:10:26 PST 2001 State-Changed-Why: I'm not an expert in this (you should check one of the CGI FAQs for details), but I believe the correct way to handle this situation is to fork a subprocess from your CGI before you send the Location: header, and make sure to close stdin/stdout/etc on the forked process. Apache can't count on CGI processes cleaning up after themselves. Thanks for using Apache! >Unformatted: [In order for any reply to be added to the PR database, you need] [to include 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! ]