httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r631362 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS server/mpm/experimental/event/fdqueue.c server/mpm/worker/fdqueue.c
Date Tue, 26 Feb 2008 19:51:32 GMT
Author: jim
Date: Tue Feb 26 11:51:29 2008
New Revision: 631362

URL: http://svn.apache.org/viewvc?rev=631362&view=rev
Log:
Merge r630335, r630348, r630350 from trunk:

Worker MPM: fix race condition
PR44402: reported and fixed by Basant Kumar Kukreja


* 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


* Add hint to PR in comment. No functional change.

Reviewed by: jim

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/server/mpm/experimental/event/fdqueue.c
    httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=631362&r1=631361&r2=631362&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Tue Feb 26 11:51:29 2008
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.9
 
+  *) 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_proxy_ftp: Fix base for directory listings.
      PR 27834 [Nick Kew]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=631362&r1=631361&r2=631362&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Tue Feb 26 11:51:29 2008
@@ -81,13 +81,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
- * Worker and Event MPMs: Fix race condition in pool recycling
-   PR 44402
-   http://svn.apache.org/viewvc?rev=630335&view=rev
-   http://svn.apache.org/viewvc?rev=630348&view=rev
-   http://svn.apache.org/viewvc?rev=630350&view=rev
-   +1: niq, rpluem, jim
-
  * Don't add bogus duplicate Content-Language entries to generated output
    PR 11035
    http://svn.apache.org/viewvc?rev=611475&view=rev

Modified: httpd/httpd/branches/2.2.x/server/mpm/experimental/event/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/mpm/experimental/event/fdqueue.c?rev=631362&r1=631361&r2=631362&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/mpm/experimental/event/fdqueue.c (original)
+++ httpd/httpd/branches/2.2.x/server/mpm/experimental/event/fdqueue.c Tue Feb 26 11:51:29
2008
@@ -194,10 +194,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. For gory details see PR 44402.
+             */
+            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/branches/2.2.x/server/mpm/worker/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c?rev=631362&r1=631361&r2=631362&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c (original)
+++ httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c Tue Feb 26 11:51:29 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. For gory details see PR 44402.
+             */
+            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;
             }
         }



Mime
View raw message