Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 87641 invoked from network); 22 Feb 2008 22:18:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2008 22:18:20 -0000 Received: (qmail 97194 invoked by uid 500); 22 Feb 2008 22:18:15 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 97152 invoked by uid 500); 22 Feb 2008 22:18:15 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 97141 invoked by uid 99); 22 Feb 2008 22:18:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 14:18:15 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 22:17:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7454B1A983A; Fri, 22 Feb 2008 14:17:45 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r630335 - in /httpd/httpd/trunk: CHANGES server/mpm/worker/fdqueue.c Date: Fri, 22 Feb 2008 22:17:44 -0000 To: cvs@httpd.apache.org From: niq@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080222221745.7454B1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: niq Date: Fri Feb 22 14:17:42 2008 New Revision: 630335 URL: http://svn.apache.org/viewvc?rev=630335&view=rev Log: Worker MPM: fix race condition PR44402: reported and fixed by Basant Kumar Kukreja Modified: httpd/httpd/trunk/CHANGES httpd/httpd/trunk/server/mpm/worker/fdqueue.c Modified: httpd/httpd/trunk/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=630335&r1=630334&r2=630335&view=diff ============================================================================== --- httpd/httpd/trunk/CHANGES [utf-8] (original) +++ httpd/httpd/trunk/CHANGES [utf-8] Fri Feb 22 14:17:42 2008 @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) Worker MPM: fix race condition in recycling a pool + PR 44402 [Basant Kumar Kukreja ] + *) mod_include: Correctly handle SSI directives split over multiple filter passes. PR 44447 [Harald Niesche ] Modified: httpd/httpd/trunk/server/mpm/worker/fdqueue.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/fdqueue.c?rev=630335&r1=630334&r2=630335&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/worker/fdqueue.c (original) +++ httpd/httpd/trunk/server/mpm/worker/fdqueue.c Fri Feb 22 14:17:42 2008 @@ -94,10 +94,14 @@ sizeof(*new_recycle)); new_recycle->pool = pool_to_recycle; for (;;) { - new_recycle->next = queue_info->recycled_pools; + /* Save queue_info->recycled_pool in local variable next because + * new_recycle->next can be changed after apr_atomic_casptr + * function call. + */ + struct recycled_pool *next = queue_info->recycled_pools; + new_recycle->next = next; if (apr_atomic_casptr((volatile void**)&(queue_info->recycled_pools), - new_recycle, new_recycle->next) == - new_recycle->next) { + new_recycle, new_recycle->next) == next) { break; } }