Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 30366 invoked from network); 4 Jan 2009 03:04:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jan 2009 03:04:42 -0000 Received: (qmail 35947 invoked by uid 500); 4 Jan 2009 03:04:41 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 35922 invoked by uid 500); 4 Jan 2009 03:04:41 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 35911 invoked by uid 99); 4 Jan 2009 03:04:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jan 2009 19:04:41 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [96.229.152.20] (HELO mail.amar.com) (96.229.152.20) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jan 2009 03:04:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=amar.com; s=Amar.com; t=1231038238; x=1231643038; q=dns/txt; h=DomainKey-Signature: Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type; bh=fS15Tov/BpjLuTMgkx+8jRZweQjOB4E1+a02aG8vKP8=; b=NXaZ8DLKk44EkUqU2Hl6OR9CdjNi7IY3oLA6fGCMunzuTCdUmWAtoIvGqJ5vCi SFYNmamAWTGDU5yroaqhSSvob/qkGZ2jSChGC7xDX+7cZYu8tkwnXhc8TLK0Z/sN 9LT+qRXAiWeKqd2oJE5oNcvFFYAvZ+auSzpVd7CGHRTR4= DomainKey-Signature: a=rsa-sha1; s=Amar.com; d=amar.com; c=simple; q=dns; h=message-id:from; b=Mh00Hv+2PDE976a4Uh9HLvswbimc9BHj+jRI7IQMNSktDiaTSbQztAhWdqaW xV1hLmEDZyFI+DU5pYauoF7mF92zMiq1EYCTIxNRqB8a1zViRkBah00JU spzAi11zcYCA6bbBgHW5NRrNH+cJOrq1bfQgyE1MmMcR0677jAleGk=; Received: from [127.0.0.1] by amar.com (MDaemon PRO v9.6.6) with ESMTP id 26-md50000002022.msg for ; Sat, 03 Jan 2009 19:03:56 -0800 X-Spam-Processed: mail.amar.com, Sat, 03 Jan 2009 19:03:56 -0800 (not processed: message from trusted or authenticated source) X-Return-Path: prvs=1255e09907=jalist@amar.com X-Envelope-From: jalist@amar.com X-MDaemon-Deliver-To: modules-dev@httpd.apache.org Message-ID: <4960271A.4050207@amar.com> Date: Sat, 03 Jan 2009 19:03:54 -0800 From: Jacques Amar User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Where to initialize a global pool/hash - server create or child_init? Content-Type: multipart/alternative; boundary="------------050406050100040509020104" X-Virus-Checked: Checked by ClamAV on apache.org --------------050406050100040509020104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Where to begin .... I am creating a global pool/hash in which I save cached, hard to calculate data (pre-compiled regex expressions etc.). I also store pages I've created using this data in memcached (using the APR interface). I can't save the calculated regex data in memcached. I initially followed the advice of creating a private pool, hash and mutex inside a child_init hook in my server config structure, protecting all access with the mutex. The module works well enough in regular httpd. However, when I tried this in worker MPM I got constant: [notice] child pid xxxxx exit signal Segmentation fault (11) after a few page loads. On a whim, I moved the whole creation of these structures into a server config hook. All these issues seem to have vanished. I have "theorized" that the pool I am creating at every child creation does not properly work. I am looking for a discussion of the pros and cons of creating this in a per child hook, versus the one time server create hook and any other pointers to help decide (and debug) where/when I should use one or the other. Boy, I hope this makes sense. --------------050406050100040509020104--