From dev-return-20772-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Thu Jul 17 11:24:52 2008 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 71580 invoked from network); 17 Jul 2008 11:24:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jul 2008 11:24:51 -0000 Received: (qmail 87130 invoked by uid 500); 17 Jul 2008 11:24:50 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 87073 invoked by uid 500); 17 Jul 2008 11:24:50 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 87062 invoked by uid 99); 17 Jul 2008 11:24:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2008 04:24:50 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bojan@rexursive.com designates 203.171.74.242 as permitted sender) Received: from [203.171.74.242] (HELO beauty.rexursive.com) (203.171.74.242) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2008 11:23:57 +0000 Received: by beauty.rexursive.com (Postfix, from userid 48) id 6A926407AC; Thu, 17 Jul 2008 21:24:20 +1000 (EST) Received: from laura.rexursive.com (laura.rexursive.com [10.1.120.25]) by www.rexursive.com (Horde Framework) with HTTP; Thu, 17 Jul 2008 21:24:20 +1000 Message-ID: <20080717212420.3879209jc5q4grmo@www.rexursive.com> Date: Thu, 17 Jul 2008 21:24:20 +1000 From: "Bojan Smojver" To: dev@apr.apache.org Subject: Re: svn commit: r677505 - /apr/apr-util/trunk/misc/apr_reslist.c References: <20080717054557.AA2E02388A45@eris.apache.org> <20080717195057.213327svh8rbt1xc@www.rexursive.com> <487F1E0A.2040102@apache.org> In-Reply-To: <487F1E0A.2040102@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.1.6) X-Virus-Checked: Checked by ClamAV on apache.org Quoting "Mladen Turk" : > So the pool P is not destroyed before its subpools, only > the callback is called before subpools are destroyed. True, but that's not what I see as the problem. Imagine R is a database connection and S a prepared statement that depends on R (i.e. uses structures R points to during destruction). If R is destroyed (i.e. pointer to it points nowhere after that), any attempt to destroy S will give segfaults. It is a reasonable APR application design to expect that if S registered a cleanup with the sub-pool of the pool from which R was allocated, that this cleanup will run OK. But, because R was already destroyed, this is not true any more. Can't you just use malloc()/free() in destructor for temporary memory needs? Both should be localised to the destructor... -- Bojan