Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 37877 invoked from network); 11 Jun 2004 15:53:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Jun 2004 15:53:46 -0000 Received: (qmail 13998 invoked by uid 500); 11 Jun 2004 15:53:50 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 13827 invoked by uid 500); 11 Jun 2004 15:53:49 -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 13814 invoked by uid 99); 11 Jun 2004 15:53:48 -0000 Received: from [196.30.143.210] (HELO gatekeeper.fma.co.za) (196.30.143.210) by apache.org (qpsmtpd/0.27.1) with ESMTP; Fri, 11 Jun 2004 08:53:48 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by gatekeeper.fma.co.za (Postfix) with ESMTP id 70822357E0; Fri, 11 Jun 2004 17:53:24 +0200 (SAST) Received: from gatekeeper.fma.co.za ([127.0.0.1]) by localhost (gatekeeper.fma.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08063-07; Fri, 11 Jun 2004 17:53:23 +0200 (SAST) Received: from sharp.fm (gatekeeper.fma.co.za [196.30.143.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by gatekeeper.fma.co.za (Postfix) with ESMTP id 1F5B7344A4; Fri, 11 Jun 2004 17:53:16 +0200 (SAST) Message-ID: <40C9D56B.7090309@sharp.fm> Date: Fri, 11 Jun 2004 17:53:15 +0200 From: Graham Leggett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040514 X-Accept-Language: en-za, en-us, en MIME-Version: 1.0 To: Brad Nicholes Cc: dev@httpd.apache.org Subject: Re: util_ldap [Bug 29217] - Remove references to calloc() and free() References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at fma.co.za X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Brad Nicholes wrote: > It appears to me that if it doesn't handle low memory situations or > it is giving false positives, those are separate issues from pools vs. > calloc/free. I still think we need to implement some better monitoring > or logging code in the cache_mgr and enhance the cache-status pages so > that we can track things like false positives. Maybe tracking the > entries by user name and authentication state rather than just the > number entries and how often the cache was hit. This is a definite plan. > Maybe the real problem is with the locking. In fact just taking a > quick scan through the code again, I am seeing something that bothers me > in util_ldap_cache_comparedn() > > if (curl) { > /* compare successful - add to the compare cache */ > LDAP_CACHE_RDLOCK(); > newnode.reqdn = (char *)reqdn; > newnode.dn = (char *)dn; > util_ald_cache_insert(curl->dn_compare_cache, &newnode); > LDAP_CACHE_UNLOCK(); > } > > It appears to be acquiring a read lock but then inserts a new node into > the cache. Shouldn't it be acquiring a write lock before doing an > insert? I would say it does. Another thing I noticed was that it didn't seem to handle the case when it was half way through adding something to the cache, and the attempt to do so failed. I plan to look at the code again in the next day or two to see if I can better figure out what it is doing. Regards, Graham --