httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r630348 - in /httpd/httpd/trunk: CHANGES server/mpm/experimental/event/fdqueue.c server/mpm/worker/fdqueue.c
Date Fri, 22 Feb 2008 22:58:44 GMT
Author: rpluem
Date: Fri Feb 22 14:58:42 2008
New Revision: 630348

URL: http://svn.apache.org/viewvc?rev=630348&view=rev
Log:
* Second part of fix for PR 44402:

  - Fix the same race condition in event MPM.
  - Slightly optimize code in worker MPM by removing the need for an additional
    dereference operation.
  - Do some word smithing on the CHANGES entry.

PR: 44402
Submitted by: Basant Kumar Kukreja <basant.kukreja sun.com>
Reviewed by: rpluem

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c
    httpd/httpd/trunk/server/mpm/worker/fdqueue.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=630348&r1=630347&r2=630348&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Feb 22 14:58:42 2008
@@ -2,8 +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 <basant.kukreja sun.com>]
+  *) Worker / Event MPM: Fix race condition in pool recycling that leads to
+     segmentation faults under load.  PR 44402
+     [Basant Kumar Kukreja <basant.kukreja sun.com>]
 
   *) mod_include: Correctly handle SSI directives split over multiple filter
      passes.  PR 44447 [Harald Niesche <harald brokenerror.de>]

Modified: httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c?rev=630348&r1=630347&r2=630348&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c (original)
+++ httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c Fri Feb 22 14:58:42 2008
@@ -201,10 +201,16 @@
                                                           (*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, next) == next) {
                 break;
             }
         }

Modified: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/fdqueue.c?rev=630348&r1=630347&r2=630348&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/fdqueue.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/fdqueue.c Fri Feb 22 14:58:42 2008
@@ -101,7 +101,7 @@
             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) == next) {
+                                  new_recycle, next) == next) {
                 break;
             }
         }



Mime
View raw message