Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 95348 invoked from network); 7 Oct 2004 19:27:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Oct 2004 19:27:42 -0000 Received: (qmail 69477 invoked by uid 500); 7 Oct 2004 19:27:25 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 69360 invoked by uid 500); 7 Oct 2004 19:27:24 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 69347 invoked by uid 99); 7 Oct 2004 19:27:23 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of trawick@gmail.com designates 64.233.170.193 as permitted sender) Received: from [64.233.170.193] (HELO mproxy.gmail.com) (64.233.170.193) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 07 Oct 2004 12:27:23 -0700 Received: by mproxy.gmail.com with SMTP id 80so2643440rnl for ; Thu, 07 Oct 2004 12:27:19 -0700 (PDT) Received: by 10.38.206.80 with SMTP id d80mr1104727rng; Thu, 07 Oct 2004 12:27:19 -0700 (PDT) Received: by 10.38.206.74 with HTTP; Thu, 7 Oct 2004 12:27:19 -0700 (PDT) Message-ID: Date: Thu, 7 Oct 2004 15:27:19 -0400 From: Jeff Trawick Reply-To: Jeff Trawick To: dev@httpd.apache.org Subject: Re: Bug: Apache hangs if script invokes fork/waitpid In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wed, 6 Oct 2004 11:01:23 -0700, Naik, Roshan wrote: > The Problem: > --------------- > I notice Apache 2(worker mpm) is not able to correctly handle > a fork/waitpid invoked by a script used with mod_perl. >From Ulrich Drepper: "No threaded programs must use anything but _exit or exec after fork." Perhaps a tiny bit harsh? What if you fork a copy of a mutex used by some third-party Apache module? That module would need to be using pthread_atfork() to make sure ownership is preserved properly. Apache/APR certainly doesn't do it with its mutexes. I think there needs to be a mod_fork which provides a more general purpose daemon than that used by mod_cgid, and some Apache API will know whether or not to send a request over there. This preserves the goal of having fork() called only by single-threaded processes so that all manner of pain is avoided.